Skip to main content
Convert2JSON

Code and Data Formatters

Make a document readable, or strip it back down for transport. Indentation, key order, line endings and the choice between one line and many are all yours to set.

Beautify, minify and normalise a document so it reads cleanly in review, or ships as small as it can.

9 tools

9 tools

Beautifying and minifying are the same tool run backwards

A formatter and a minifier disagree about one thing: whether whitespace is worth its bytes. Beautifying adds indentation and line breaks so a human can see the structure; minifying removes every byte a parser does not need so the payload travels light. Neither changes what the document means, which is the property that makes both safe to apply to something you did not write.

That property has a limit worth knowing. For JSON the round trip is exact — parse, re-serialise, and the values are identical. For SQL, HTML, CSS and JavaScript, formatting is a rewrite of source text, and while these formatters do not intend to change behaviour, a formatter is not a compiler and cannot prove it. Review the diff on anything you are about to commit.

The options that change the output

Indentation is the obvious one: two spaces, four spaces, or a tab, matching whatever the file’s neighbours already use. Sorting keys is the one people underestimate — alphabetising object keys makes two versions of the same payload diffable, which turns an unreadable review into a three-line one. It also changes the file, so it belongs in a deliberate normalisation pass rather than in the middle of debugging something else.

Line endings matter on mixed-platform teams: a file written with CRLF and re-saved with LF shows every line as changed. And escaping non-ASCII characters as \uXXXX keeps a payload safe through pipelines that mangle raw UTF-8, at the cost of a file no human can read. Each of these is a choice with a real trade-off, which is why they are options and not silent defaults.

Nothing is uploaded

Formatting happens in this tab. The formatters run as pure functions in your browser, large documents are handed to a Web Worker so the page stays responsive rather than freezing, and no request carries your source anywhere. You can confirm it: open the network panel and reformat something.