What Gets Lost Converting YAML to JSON and Back
Converting or reformatting YAML drops comments, turns anchors into copies, and rounds big numbers. See what we observed running js-yaml.
Beautify or minify JSON, JavaScript, HTML, CSS, and YAML. Free, private — nothing leaves your browser.
Your beautified code will appear here.Format, validate, and minify JSON with your choice of indent. Errors show where the problem is. Nothing is uploaded.
Convert JSON, CSV, and YAML in any direction — CSV and YAML convert through JSON automatically.
Encode text to Base64 or decode Base64 back to text, instantly.
JSON, JavaScript, HTML, CSS, and YAML, switchable in one click without losing what you pasted.
Readable output with your choice of 2 spaces, 4 spaces, or tabs, or the smallest possible size.
The result updates as you type or paste. No button to click and no page reload.
Invalid JSON, YAML, or JavaScript shows what went wrong and where, instead of failing silently.
Copy the result to your clipboard or save it as a .json, .js, .html, .css, or .yaml file.
Your code never leaves your browser. Nothing is uploaded, logged, or stored.
Paste JSON, JavaScript, HTML, CSS, or YAML into the input box.
Choose the language, then Beautify for readable output or Minify for the smallest size. For beautified output you can also choose 2 spaces, 4 spaces, or a tab.
The output updates as you type. Copy it with one click, or download it as a file.
Code gets squashed into one line for production and messy when it is pasted between tools. Beautifying and minifying are the two moves that put it back, or shrink it down.
Re-indent a minified JavaScript or CSS file so you can follow what it does while debugging.
Minify JSON before embedding it in a request, a fixture, or a environment variable.
Make code from a forum, email, or chat match a consistent indent before it goes into your project.
Paste YAML or JSON to confirm it is valid and see its structure laid out properly.
Beautifying adds line breaks and indentation so people can read the code. Minifying does the opposite: it removes whitespace and comments, and for JavaScript it also shortens variable names, so the file is as small as possible. Both give code that behaves the same. JSON and YAML are re-written from their parsed data, so comments, YAML anchors and numbers with more than about 15 digits are not preserved.
JSON, JavaScript, HTML, CSS, and YAML. All five can be beautified. JSON, JavaScript, HTML, and CSS can also be minified. YAML cannot, because indentation is part of its syntax.
Yes. The JavaScript minifier shortens local variable and function names to save space. Names that are visible outside the code you pasted, like top-level functions, are kept so that other code can still call them.
Yes. Beautify restores structure and indentation, so a minified file becomes readable. Original variable names and comments are gone for good, so names will stay short.
The input is not valid for the language selected. A common cause is the Language setting not matching what you pasted. For JSON, check for single quotes, unquoted keys, and trailing commas.
No. Everything runs in your browser. Nothing is sent to a server, logged, or stored.
Free, no account needed.