JSON to Base64 Converter
Encode a JSON document as Base64, or decode Base64 back into JSON, with accents and emoji surviving both directions.
JSON
Syntax colouring is off for this document because recolouring something this large on every keystroke would slow typing down. Every tool still works normally.
Base64
Syntax colouring is off for this document because recolouring something this large on every keystroke would slow typing down. Every tool still works normally.
The result appears here.
A decoded file is not shown as text. Choose a filename and download it.
Runs entirely in your browser. Nothing you paste is uploaded, and you can confirm that in your browser Network tab.
About this tool
Base64 exists to carry bytes through something that only handles text, which is why it turns up in data URLs, in mail attachments, in JSON Web Tokens and in any configuration file that has to hold a document inside a string. The part browser tools usually get wrong is text that is not ASCII: the browser function for Base64 refuses anything above U+00FF, so one accent, rupee sign or emoji makes it throw. This encodes to UTF-8 bytes first, which is what every other language does, so the result matches what your server produces for the same document. Decoding accepts a data URL prefix, line breaks, and the URL safe alphabet that uses minus and underscore. It also tells three failures apart: text that is not Base64, bytes that are not text, and a decode that worked perfectly and did not produce JSON. A mode picker offers plain text and a real file alongside JSON: text mode skips the JSON check, and file mode moves raw bytes the whole way, so a photo or a PDF can become Base64, or Base64 can become a downloaded file again, without either ever needing to be valid UTF-8. A data URL toggle wraps the result with a MIME type, on any mode, for pasting straight into an img src or a CSS url().
How to use
- Choose a direction and a mode, then paste your document, your text or your Base64 into the left pane, or choose a file in file mode.
- Press Convert. Encoding a JSON document checks that it is valid JSON first; text and file mode encode exactly what was given.
- Copy the result, or download it as a file. Decoding a file offers a filename and a download instead of a text preview.