Skip to content
uencoder
TASK

Encode binary data into a JSON-safe string

Convert raw bytes (images, encrypted blobs, file contents) into a Base64 string that can be embedded inside a JSON field without breaking the structure.

  1. 1

    JSON cannot carry raw bytes — all string values must be valid Unicode. Base64 encodes arbitrary bytes into ASCII letters, digits, and +/ which are all JSON-safe, making it the standard way to embed binary payloads.

  2. 2
    Base64 Encoder →

    Paste or upload the binary data. The tool outputs a Base64 string with no line breaks, ready to paste as a JSON string value.

  3. 3
    json-format → base64-encode → url-encode

    When the JSON containing the Base64 field must itself go into a URL, use this chain: it Base64-encodes the binary, wraps it in JSON, and percent-encodes the result.

  4. 4
    JSON Formatter →

    Wrap the Base64 string in a JSON object like {"data":"<base64>","type":"image/png"} and format it to verify the structure is valid.

Frequently asked questions

Why not use hex instead of Base64 for JSON?
Hex works but doubles the size (2 chars per byte vs Base64's 1.33). For large binaries the size difference matters; Base64 is the conventional choice for JSON-embedded binary.
How do I include the MIME type?
Store it as a sibling field (e.g. "mimeType":"image/png") or build a data URI (data:image/png;base64,<...>). The data URI form lets browsers render it directly in an <img> tag.

Workflows that solve this

Convert Ascii85 to Base64
Decode Ascii85 and re-encode as Base64 for wider compatibility.
PIPELINE
Convert Base2048 to Base64
Decode Base2048 (emoji) and re-encode as Base64 for standard transport.
PIPELINE
Convert Base32 to Base64
Decode a Base32-encoded string into raw bytes and re-encode as Base64 for more compact representation.
PIPELINE
Convert Base58 to Base64
Decode Base58 and re-encode as Base64 for standard compatibility.
PIPELINE
Base64 encode then decode round-trip
Encode text to Base64 and decode it back to verify the round-trip preserves the original data.
PIPELINE
Blowfish Encrypt then Base64
Blowfish encrypt then Base64-encode for text-safe transport.
PIPELINE
Compare two YAML configs via JSON
Convert YAML configs to JSON for diff-friendly comparison of structured values.
PIPELINE
DES Encrypt then Base64
DES encrypt then Base64-encode for legacy compatibility.
PIPELINE
Encode a JSON payload for URL transport
Prepare a JSON document for a URL parameter: pretty-print, Base64-encode, then percent-encode — the exact inverse of the nested-parameter decode chain.
PIPELINE
AES encrypt then Base64 encode
Encrypt plaintext with AES and encode the ciphertext as Base64 for text-safe transport.
PIPELINE
Hash content and encode as Base64
Compute a hash of the input and encode the hash digest as Base64 for compact transport.
PIPELINE
Convert Hex to Base64
Decode a hexadecimal string into raw bytes and re-encode it as Base64 for compact transport.
PIPELINE
HJSON to JSON Format
Format HJSON then convert to standard JSON.
PIPELINE
HMAC Sign then Base64 Encode
Generate HMAC signature then Base64-encode for API auth headers.
PIPELINE
Format JSON and compute integrity checksum
Pretty-print a JSON document and compute a CRC32 checksum to detect any subsequent modifications.
PIPELINE
Minify and validate JSON
Format JSON for inspection and validate it is syntactically correct in one pass.
PIPELINE
Format JSON and generate TypeScript interface
Format a JSON document then infer a TypeScript interface definition in one chain.
PIPELINE
Validate, format, then convert JSON to YAML
Convert a (possibly minified) JSON config to YAML, catching syntax errors at the first node instead of producing subtly wrong YAML.
PIPELINE
JSON5 to JSON Format
Format JSON5 then convert to standard JSON.
PIPELINE
JSONC to JSON Format
Format JSONC (JSON with comments) then convert to standard JSON.
PIPELINE
Morse Encode and Base64 Transport
Encode text as Morse code then Base64-encode for digital transport.
PIPELINE
Decode and format a JWT payload
Parse a JWT token, extract its payload, and format the JSON for inspection.
PIPELINE
Parse Query String and Format JSON
Parse query string into key-value pairs then format as JSON.
PIPELINE
RC4 Encrypt then Base64
RC4 encrypt then Base64-encode for transport.
PIPELINE
RIPEMD-160 Hash then Base64
Compute RIPEMD-160 hash then Base64-encode for transport.
PIPELINE
Kebab Case and URL Encode
Convert to kebab-case then URL-encode for safe URL slugs.
PIPELINE
Shuffle Text and Base64 Encode
Shuffle text characters then Base64-encode the result.
PIPELINE
Convert TOML to JSON
Parse a TOML configuration file into JSON for tools and APIs that expect JSON input.
PIPELINE
Convert TOML to YAML via JSON
Transform a TOML configuration file into YAML format, using JSON as an intermediate representation.
PIPELINE
Unicode Escape and Base64 Encode
Unicode-escape text then Base64-encode for ASCII-safe transport.
PIPELINE
URL Encode then Base64 Double Encode
URL-encode then Base64-encode for double encoding in API payloads.
PIPELINE
Encode a text payload for URL transport
Percent-encode text then show its hex representation for safe URL parameter transport.
PIPELINE
Decode nested URL parameter (Base64 JSON)
Unwrap a URL parameter that carries URL-encoded Base64 JSON into readable, formatted JSON.
PIPELINE
UUencode then Base64
UUencode text then Base64-encode the result for double encoding.
PIPELINE
Generate UUID and Base64 Encode
Generate a UUID then Base64-encode it for compact storage.
PIPELINE
Generate TypeScript interfaces from YAML
Convert a YAML document to TypeScript interface definitions, using JSON as an intermediate format.
PIPELINE

Learn more

Want to understand why?

Related tools