JSON formatter: pretty-print, minify and validate JSON online

Paste JSON to pretty-print it, minify it, sort the keys, fold it as a tree, or turn it into an escaped string. Mistakes are pointed out by line and column.

Keep it one tap away for everyday use.

Bookmark JSON formatter?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

Or install fibub as an app: every tool you open then works offline.

  1. Paste JSON
  2. Choose
  3. Check
  4. Copy
Nothing is uploadedWorks offline once open

Pretty-print adds line breaks and indents. Minify removes every space. Escape turns the text into one quoted JSON string. Unescape does the reverse.

Result

 

Tree view

Tap an arrow to fold or open. ·

What it does

JSON is the plain-text format that websites, apps and settings files use to pass data around. It is easy for computers to read and hard for people to read when it is squashed onto one line. This tool lays it out with line breaks and indents (pretty-print), squeezes it back down to the smallest size (minify), sorts the keys from A to Z so two files can be compared, and shows the data as a tree you can fold and open.

If the JSON has a mistake, the tool says exactly where: the line and column of the first problem, what it expected, and a short excerpt with an arrow under the spot. Everything runs in your browser, so private data, tokens and API replies never leave your device. Once you have tidy JSON, JSON compare shows what changed against another version, and config converter turns it into YAML, XML, TOML or CSV.

How to use it

  1. Paste your JSON into the box. The result appears straight away, and a valid example is already loaded.
  2. Pick what you want: Pretty-print, Minify, Escape as string or Unescape string.
  3. Choose the indent (2 spaces, 4 spaces or a tab) and tick Sort keys if you want them in order.
  4. Press Copy result or Download. Open the tree to browse a large document.

What each setting does

  • Pretty-print: puts each key and list item on its own line, indented by the width you choose.
  • Minify: removes every space and line break. The data is the same, only smaller.
  • Sort keys A to Z: reorders the keys of every object alphabetically (lists keep their order). Useful before comparing two files.
  • Escape as string: turns any text, such as a block of JSON, into one quoted JSON string with \" and \n in place, ready to paste into code or another JSON field.
  • Unescape string: the reverse. Paste "say \"hi\"\nok" and get the real text on two lines.
  • Tree view: every object and list can be folded. The first two levels start open.

Worked example

The example {"name":"fibub","tags":["free","private"],"size":{"w":10,"h":2.5},"live":true,"note":null} is 90 characters. Pretty-printed with 2 spaces it becomes 13 lines and 139 characters. If you paste five lines where line 3 is "b": [1, 2,], the tool says “Mistake at line 3, column 14: A trailing comma before ”]” is not allowed”, because JSON, unlike JavaScript, forbids a comma after the last item.

FAQs

Is my JSON uploaded anywhere? No. It is read and written by your own browser and never sent to a server.

Why does it reject single quotes or comments? Real JSON allows only double-quoted strings and no comments. The error message tells you which one it found.

Does it keep very large numbers exactly? Numbers are read as ordinary JavaScript numbers, so integers above 9,007,199,254,740,991 lose their last digits. Keep such IDs as strings.

Does sorting change the meaning? For objects, no: key order carries no meaning in JSON. Lists are never reordered.

How big a file can it handle? A few megabytes is fine. The tree view is skipped above about 20,000 values to keep the page quick.

Where the numbers come from

  • JSON syntax as defined in RFC 8259 and ECMA-404, checked by fibub's own small parser. fibub's own working.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Read more on the Blog

Last updated 2026-12-05.

Related tools

Table converter #T540 Paste cells from Excel, Google Sheets or LibreOffice, or open a CSV or Excel file, and get a LaTeX table (booktabs rules, caption and label, siunitx decimal alignment), a Markdown table or an HTML table. Special characters are escaped and numbers can be rounded the way you would on paper. Regex tester #T853 Type a regular expression and some text to see every match highlighted, each numbered and named group listed, and a live preview of a replacement with $1. JSON compare #T1088 Paste two JSON documents and see what was added, removed or changed, key by key, as a path list and a side-by-side view. Config converter #T1089 Convert between JSON, YAML, TOML, XML and CSV in your browser. Paste a config or data file, pick the new format, copy or download the result. XML formatter #T1090 Paste XML to pretty-print or minify it and check that it is well-formed. A broken tag is pointed out by line and column. SQL formatter #T1128 Paste SQL to lay it out with each clause on its own line, choose upper or lower case keywords, comma style and indent size, or minify it to one line. Works for common SQL such as SQLite, PostgreSQL, MySQL and SQL Server, and runs in your browser. Code beautifier #T1129 Paste HTML, CSS or JavaScript to lay it out with indents and line breaks, or minify it to save bytes. Shows how many bytes you saved. The code is only read, never run, and stays in your browser. Markdown table maker #T1132 Fill an editable grid, set each column's alignment, paste cells from Excel or a CSV, and copy the table as Markdown, HTML or LaTeX. Paste an existing Markdown table to edit it again. Everything stays in your browser.