JSON to Base64

    Encode JSON objects and API payloads to Base64 with formatting, copy, and download actions.

    Browser only Base64 Ready
    JSON Input
    7 lines
    1
    2
    3
    4
    5
    6
    7
    Ln 1, Col 1
    126 charsUTF-8 126 B7 lines
    Base64 Output
    1 line
    1
    Ln 1, Col 1
    0 charsUTF-8 0 B1 line

    JsonifyTools · JSON encoding guide

    Turn a JSON string into Base64 your integration can accept.

    Paste JSON, choose Standard, URL-safe, or MIME output, and copy the encoded value. Format or minify the input when you need control over the exact text being encoded.

    JSON to Base64 encoderEncode JSON onlineUTF-8 JSONURL-safe Base64JSON data URIBase64 API payload

    Understand the conversion

    What does JSON to Base64 mean?

    JSON is already text. A JSON to Base64 converter takes the characters in that text, represents them as UTF-8 bytes, then maps the bytes to Base64 characters. JSON exchanged between systems uses UTF-8 as described in RFC 8259. The result is a text string that can carry those bytes through a field or protocol that expects Base64.

    This is a text conversion, not a JSON transformation. The encoder does not reorder keys, remove spaces, validate your schema, or make the content secret. It encodes exactly what is in the input editor. If formatting changes, the bytes—and therefore the Base64 output—change too.

    Base64 is larger than the source: every three input bytes become four Base64 characters, with padding for a final partial group. For ordinary API requests, send JSON directly unless a documented field asks for an encoded value.

    The input stays recognizableA simplified view of JSON text encoding

    JSON text

    {"ok":true}

    Base64 text

    eyJvayI6dHJ1ZX0=

    The encoded output can be decoded back to the same UTF-8 JSON characters.

    A short, repeatable workflow

    How to convert JSON to Base64 online

    The encoder updates as you edit, so you can inspect a result without leaving the page.

    1. 01 · Add your JSON

      Paste or upload

      Paste a JSON object or use the editor’s upload action to open a .json file. The tool encodes the entered text, including spaces and line breaks.

    2. 02 · Prepare the text

      Format if needed

      Use Format to make valid JSON easier to read or Minify to remove extra whitespace. These actions change the source text and its Base64 output.

    3. 03 · Match the receiver

      Choose and copy

      Select the required Base64 variant, then copy or download the result. Turn on the data URI option only when the destination expects a URI.

    Match the output format

    Standard, URL-safe, and MIME Base64

    A receiver’s specification decides which variant to use. Changing variants changes the Base64 representation, not the underlying JSON bytes.

    + / =

    Standard Base64

    Use the familiar RFC 4648 alphabet when a JSON field, API, or file format specifies standard Base64. Padding may appear at the end.

    - _ =

    URL-safe Base64

    This RFC 4648 URL-safe alphabet substitutes - for + and _ for /. JsonifyTools keeps equals padding if the encoded length needs it; some protocols separately require padding to be removed.

    76 characters per line

    MIME Base64

    MIME output wraps long Base64 text with line breaks for mail-compatible workflows. Choose it only when the receiving format expects wrapped lines.

    See what changes

    JSON to Base64 examples

    Each output below is calculated from the exact input shown. Copy an encoded sample to check a decoder or test fixture.

    A compact JSON value

    Encode a small JSON object for a field that accepts Base64 text.

    Input JSON

    {"ok":true}

    Base64 output

    eyJvayI6dHJ1ZX0=

    The equals sign is padding. It is part of this standard Base64 result.

    Unicode stays readable after decoding

    Send non-English text through a system that expects Base64-encoded UTF-8.

    Input JSON

    {"city":"東京"}

    Base64 output

    eyJjaXR5Ijoi5p2x5LqsIn0=

    The tool encodes the UTF-8 bytes for the full JSON string, including its punctuation.

    URL-safe alphabet

    Choose URL-safe when a receiving format specifically requires the Base64URL alphabet.

    Input JSON

    {"data":"ÿÿx"}

    Standard output

    eyJkYXRhIjoiw7/Dv3gifQ==

    URL-safe output

    eyJkYXRhIjoiw7_Dv3gifQ==

    The slash changes to an underscore; the two equals signs remain as padding.

    Made for real payload work

    What you can do with this JSON Base64 encoder

    The page pairs a direct JSON input with a live Base64 output and practical controls for preparing the value.

    JSON text and files

    Paste a payload or load a .json file, then encode the exact text you need.

    Standard, URL-safe, and MIME

    Select the Base64 alphabet or line wrapping expected by the system receiving the value.

    Format or minify first

    Inspect readable JSON or remove whitespace before encoding. The output follows the text you choose.

    Copy, download, or make a data URI

    Copy the encoded string, save it as a text file, or add the application/json data URI prefix.

    Review output size

    Check input bytes, encoded character count, and selected variant before using a payload in another system.

    A realistic debugging moment

    Why a payload can decode correctly and still fail a check

    A developer is testing a service that asks for a Base64-encoded JSON field. The JSON looks right, and the receiver decodes it, but a downstream check expects a byte-for-byte payload and reports a mismatch.

    The input had indentation and a trailing newline; the expected fixture was minified. Both versions describe the same object, yet their text bytes differ. The developer uses Minify, copies the new output, then confirms the service’s requirements for alphabet and padding. The value now matches the fixture because the source text matches—not because Base64 changed the JSON structure.

    This is useful for QA, but it is also a reminder: for signatures, checksums, and exact request-body verification, follow the provider’s canonicalization rules. Do not change whitespace or key order unless the specification says to.

    Same JSON values, different source bytes

    Readable form

    { "ok": true }

    Minified form

    {"ok":true}

    The object values are equivalent, but the whitespace bytes differ. Base64 output differs as well.

    Use Base64 when the format calls for it

    Common JSON to Base64 use cases

    Base64 is a representation for specific interfaces, not a default wrapper for every JSON request.

    API fields that explicitly expect Base64

    Some APIs define a request field as a Base64 string. Encode only that field’s JSON value and follow the endpoint’s required alphabet, padding, and size rules. Most JSON APIs accept ordinary JSON directly, so Base64 is not needed unless the contract asks for it.

    Integration and QA checks

    Create a known input/output pair while testing an importer, webhook consumer, or SDK. Use the same whitespace and character encoding as the production payload when exact bytes matter.

    Configuration and manifests

    Prepare a JSON value for a format that stores data as Base64. Kubernetes Secret manifests use Base64 for representation, but it does not encrypt the value; protect the manifest and cluster access separately.

    URL-safe structured values

    Use the URL-safe option when the destination specifically expects Base64URL characters. It replaces + and /, but this tool retains padding; confirm the receiver’s rules before placing a value in a URL.

    Small inline JSON resources

    For an application that deliberately embeds a small JSON resource, turn the output into a data URI with the application/json media type. Inline Base64 adds size and is not a substitute for a normal JSON request or file.

    Base64 does not protect JSON secrets

    Base64 is reversible encoding. It does not encrypt a JSON payload, hide an API key, or authenticate the sender. A Kubernetes Secret value may appear Base64-encoded in a manifest, but anyone who can read that value can decode it. Follow the Kubernetes Secret security guidance and protect credentials with the access controls, encryption, and transport security required by your environment.

    Quick answers

    JSON to Base64 FAQs

    What does a JSON to Base64 encoder do?

    It converts the UTF-8 bytes of JSON text into Base64 characters. The result represents the original text; it does not compress, encrypt, or validate the JSON.

    Does the input have to be valid JSON?

    The encoder converts the text you enter, whether or not it parses as JSON. The Format and Minify actions do require valid JSON and show an error when parsing fails.

    Why does changing spaces change the Base64 output?

    Base64 encodes exact bytes. Indentation, line breaks, key order, and other text changes produce different bytes, even when two JSON documents describe equivalent data.

    What is the difference between Standard and URL-safe Base64?

    Standard Base64 uses + and /. URL-safe Base64 replaces those characters with - and _. This tool preserves padding when present; check whether the receiving format expects it.

    Can I use this output as a JWT?

    This tool can encode a JSON string, but it does not build or sign a JWT. JWT header and payload segments use Base64URL without padding as specified for compact JWS, followed by a signature. This encoder keeps padding, so use a JWT tool and validate the signature as required.

    Is Base64 a way to protect API keys or JSON secrets?

    No. Base64 is reversible encoding, not encryption. Anyone with the value can decode it. Use the security controls required by your system to protect secrets.

    Can I encode a .json file?

    Yes. Use the input editor’s upload control to load a JSON file. Its text is encoded like pasted JSON, and the output can be copied or downloaded.