Skip to main content

Three-step workflow

Format and prepare JSON for sharing

Format a small JSON sample, encode it as Base64, and safely escape one URL query value.

Outcome: The sample {"id":1} produces ewogICJpZCI6IDEKfQ%3D%3D for one query value.

  1. Step 1

    Format and validate the JSON

    Enter {"id":1}. Select space indentation with 2 spaces. Run the formatter and copy its complete three-line result.

    The exact result is {, a line break, two spaces followed by "id": 1, a line break, and }.

    Open JSON Formatter
  2. Step 2

    Encode the formatted JSON

    Select Encode mode and Alphabet A-Za-z0-9+/=. Paste the formatted result without an extra final line break. Expect ewogICJpZCI6IDEKfQ==.

    Indentation and line breaks change the encoded value. This example uses LF line breaks, not CRLF.

    Open Base64 Encoder and Decoder
  3. Step 3

    Prepare the value for a URL field

    Select Encode mode and enable Encode all special chars. Enter ewogICJpZCI6IDEKfQ==. Expect ewogICJpZCI6IDEKfQ%3D%3D.

    The default setting preserves reserved characters. Enable this option when you encode a value, not a complete URL.

    Open URL Encoder and Decoder

Before you finish

Check the result

  • A sample query is ?data=ewogICJpZCI6IDEKfQ%3D%3D. The receiving application must expect percent-encoded Base64 JSON.
  • Verify in reverse order: URL Decode, then Base64 Decode. Expect the same formatted three-line JSON.
  • Do not encode twice. URL builders can already encode query values. Check the receiving system's requirements.
  • Syntax validation does not verify required fields or business rules. Base64 does not encrypt the JSON.
  • Do not place secrets in URLs. Browsers and servers can store complete URLs.
  • Send large JSON documents as files instead of long URL values.