JSON Formatter
Pretty-print, validate and minify JSON with friendly error messages.
Encode text to Base64 or decode Base64 back to text, with UTF-8 support, in your browser and never uploaded.
Your result is ready — download it below:
Re-encoded without size gain Download links expire within 30 minutes.
No result to display for the current input.
Encode text to Base64 or decode Base64 back to text, with UTF-8 support, in your browser and never uploaded.
Base64 turns text into a form that survives places plain text cannot, such as a URL parameter, an email header or a JSON string field. Paste a value, choose a direction, and the result appears immediately. Encoding handles UTF-8 so accented characters and emoji survive the round trip, and decoding ignores the spaces and line breaks that command line tools add. The whole thing runs in your browser.
Base64 exists to move binary or text data through channels that only handle a restricted character set. It is how HTTP basic authentication carries credentials, how a data URI embeds an image in CSS, how an email attachment is marked, and how JWT segments are written. In each case the encoded form is safe to paste into a header, a URL or a JSON value without escaping.
It was not designed to be compact. Encoding always produces about a third more characters than the input, and the padding you see at the end of a result is not corruption: it marks the final group so the length is a multiple of four, which is how a decoder knows where the data ends.
There is no key and there is no secret. Anyone can decode a Base64 string as easily as you just did, so it provides no confidentiality whatsoever. Treating it as protection is one of the most common security mistakes made with configuration files and credentials.
It does buy one thing: a string that looks opaque is not casually readable or searchable. That is a small obstacle to accident and shoulder surfing, and nothing more. For an actual secret use a password hash, an encryption key or a secret manager.
Base64 operates on bytes, not characters, and the number of bytes is not the number you see. An accented letter or an emoji takes several bytes in UTF-8, so encoding always uses more input bytes than the character count suggests. Both figures are reported alongside the output so an unexpected result is easy to explain.
Decoding checks that the bytes are valid UTF-8 text. When they are not, the result is usually a file or image that was encoded rather than a string, and the tool says so instead of printing replacement characters you cannot interpret. A decoded value that is one unbroken token is flagged as likely secret material.
Command line tools wrap long output. base64 on a modern system inserts a line break every 76 characters, and OpenSSL certificate output is wrapped too, which is why a PEM key is a multi-line document. Copying that output as-is gives a string with newlines in the middle.
Decoding here removes all whitespace first, so wrapped output pastes directly. What is still rejected is a genuinely malformed value: characters outside the alphabet, or a length that is not a multiple of four once the line breaks are gone, both of which mean the string was truncated or was never Base64 to begin with.
Encoding and decoding are arithmetic on a string, so there is nothing to send to a server. This tool performs both operations in your browser: the value you paste is never uploaded, logged or stored, and there is no account involved.
That property is worth more than usual for this particular tool. A Base64 encoder is frequently pointed at API keys, connection strings and tokens precisely because the next step needs them encoded, which makes it one of the worst places to introduce an upload.
No. Base64 is an encoding with no key, so anyone can decode it immediately. It hides a value from casual reading and nothing more. Store secrets hashed or encrypted, and if you must move one, send it over a channel that is already protected.
Those are padding. Base64 works in groups of three bytes, which become four characters, so a final group that is short is padded with = to reach a multiple of four. A decoder uses that to know where the data ends.
Those bytes are binary rather than text, which usually means you encoded a file or an image. The tool refuses rather than showing replacement characters, because the decoded value is meaningful data and not a string you could read.
Yes. Spaces and line breaks are removed before decoding, so the wrapped output of base64 or openssl pastes as is. The result is reported as text containing line breaks, which is the expected shape for a key or certificate.
Base64 Encoder converts text to Base64 and decodes Base64 back to readable text. Encoding is UTF-8 safe, so accents and emoji survive the round trip, and decoding ignores spaces and line breaks so wrapped output pastes cleanly.
How to use: pick a direction, paste your value, and press Run.
Pretty-print, validate and minify JSON with friendly error messages.
Turn any JSON into ready-to-compile Rust struct definitions with serde derives.
Turn any JSON into a TypeScript Zod schema with nullable and optional handling.
Convert any JSON into Go struct definitions with json tags and pointers for optionals.