PixelTools

Code beautifier & minifier

Beautify or minify JSON, JavaScript, HTML, CSS, and YAML. Free, private — nothing leaves your browser.

0 characters
Beautified JSON0 characters
Your beautified code will appear here.
✓Free forever
✓Runs locally
✓No account
✓No watermark

Everything you need to clean up code

Five languages in one tool

JSON, JavaScript, HTML, CSS, and YAML, switchable in one click without losing what you pasted.

Beautify or minify

Readable output with your choice of 2 spaces, 4 spaces, or tabs, or the smallest possible size.

Instant, live output

The result updates as you type or paste. No button to click and no page reload.

Clear error messages

Invalid JSON, YAML, or JavaScript shows what went wrong and where, instead of failing silently.

Copy or download

Copy the result to your clipboard or save it as a .json, .js, .html, .css, or .yaml file.

100% private

Your code never leaves your browser. Nothing is uploaded, logged, or stored.

Beautify or minify in three steps

  1. 1

    Paste your code

    Paste JSON, JavaScript, HTML, CSS, or YAML into the input box.

  2. 2

    Pick the language and Beautify or Minify

    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.

  3. 3

    Copy or download the result

    The output updates as you type. Copy it with one click, or download it as a file.

Built for everyday developer work

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.

Reading minified production code

Re-indent a minified JavaScript or CSS file so you can follow what it does while debugging.

Shrinking API payloads and config

Minify JSON before embedding it in a request, a fixture, or a environment variable.

Cleaning up pasted snippets

Make code from a forum, email, or chat match a consistent indent before it goes into your project.

Checking a config file

Paste YAML or JSON to confirm it is valid and see its structure laid out properly.

Frequently asked questions

What is the difference between beautifying and minifying code?

+

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.

Which languages does the code beautifier support?

+

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.

Does minifying JavaScript rename my variables?

+

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.

Can I beautify minified code I did not write?

+

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.

Why does my JSON or YAML show an error?

+

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.

Is my code uploaded anywhere?

+

No. Everything runs in your browser. Nothing is sent to a server, logged, or stored.

Clean up your code now

Free, no account needed.