Convert JSON to Base64
Encode JSON data to Base64. Runs entirely in your browser, so your data never leaves your device.
0 chars · 0 lines
Output
The result appears here as you type.
How to use Convert JSON to Base64
- 1. Paste your JSON. Paste the JSON object or array you want encoded. It can be minified or formatted; the encoder reads the raw text and converts every byte to Base64.
- 2. Choose URL-safe encoding if needed. Turn on URL-safe (Base64URL) to replace the plus and slash characters standard Base64 uses with dash and underscore, which is required when the encoded string will appear in a URL or a filename.
- 3. Copy the encoded string. Copy the resulting Base64 text and paste it into a URL query parameter, an authentication token, or anywhere JSON needs to travel as plain ASCII text.
When to use Convert JSON to Base64
Convert JSON to Base64 encodes a JSON document as an ASCII-safe string that can travel through systems not designed to handle raw JSON text, like URL query parameters or binary-unsafe fields. This is the same encoding btoa performs in a browser.
- Passing JSON state through a URL. You need to encode a small JSON object, like filter settings or a shared session state, into a URL query parameter without special characters breaking the link.
- Building a JWT payload by hand. You are constructing a JSON Web Token manually to understand its structure, and need to Base64URL-encode the header and payload segments the way the spec requires.
- Embedding JSON in a data URI. You want to inline a small JSON document directly into an HTML attribute or a config value as a data URI, which requires the content to be Base64-encoded first.
- Storing structured data in a binary-unsafe field. A legacy system's field only accepts plain ASCII text, but you need to store a JSON object in it, so encoding to Base64 first avoids corrupting the data.
Examples
Encode a small object
Input
{"a":1}Output
eyJhIjoxfQ==
About the Convert JSON to Base64 tool
Convert JSON to Base64 runs as plain JavaScript in your browser tab, with no server behind it. Encode JSON data to Base64. Whatever you put in stays on your device from start to finish.
The tool is part of EditSafely's JSON Tools section, 90 single-purpose utilities built around the same idea: open the page, get the result, keep your data to yourself.
You can shape the output with the URL-safe (Base64URL) setting, and the result refreshes the moment you change it. A worked example further down the page shows exactly what the tool produces for a real input.
That local-first design has practical benefits beyond privacy. The tool keeps working on a flaky connection once the page has loaded, results are instant because nothing round-trips to a server, and it is safe to use with confidential material.
Frequently asked questions
Is Convert JSON to Base64 free to use?
Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.
Is it safe to paste sensitive or confidential data?
Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.
How much text can I process at once?
There is no fixed limit. Because the work happens on your own device rather than on a shared server, the practical ceiling is your machine's memory, which comfortably handles inputs far larger than typical online tools allow.
Do I need to sign up or install anything?
No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.
How do I use the result?
The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.