JSON
Paste and read. It takes almost-JSON, points at the error and leaves your data alone. Nothing leaves your browser.
paste some JSON and it shows up here
How to format JSON online
Paste your JSON in the box on the left, drop a file on it, or click open file. The result shows up next to it, indented and with a color for each kind of value. To open or close an object or a list, use the arrow next to it, or open all and close all.
To take the result with you, use copy (with 2 spaces, 4 spaces or a tab) or copy minified, which removes the white space and puts it all on one line. On each line of the viewer, copy takes just that value and path copies its address, like order.items[0].price, ready to use in code.
How to find the error in invalid JSON
When the text is not JSON, the tool says in plain words what is wrong, with line and column, and go to the error takes the cursor to the exact spot. The most common errors:
- A trailing comma after the last item, as in
["a", "b",]. - A key or text without double quotes: in JSON,
name: 'Ana'has to be"name": "Ana". - A bracket or brace that never closes: the message points at the line where it opened.
- A number with a leading zero, like
007. If it is a code, it goes in quotes.
JSON from logs, Python or JavaScript
A lot of what you need to read is not strict JSON: an object copied from the console, a Python print with True and None, JSON escaped inside a string ("{\"event\":\"login\"}"). Instead of refusing it, the formatter fixes what is safe to fix and shows a list of notes: comments removed, single quotes changed, commas added, strings with JSON inside opened. Nothing is fixed silently.
Questions
- Is my data sent to a server?
- No. The formatter runs entirely in your browser, and the page itself forbids the browser from opening any connection. You can paste tokens, customer data or production logs safely.
- Does the formatter change any value?
- No. Big numbers like
12345678901234567890and decimals like10.50show up exactly as they came. JavaScript'sJSON.parsewould round the first one and drop the zero from the second. - What is almost-JSON?
- Text that looks like JSON but that
JSON.parserejects, such as JavaScript objects, Python dictionaries and config files with comments. The tool fixes what can be fixed safely and lists every fix. - Does it handle large files and JSON Lines?
- Yes. Files of several megabytes open bit by bit, and several JSON values in a row (JSON Lines or NDJSON, common in logs) become a list of documents.
More tools
- text converterCaseType once and get every case at the same time, from Title Case to snake_case. One click copies.
- chess game analysisPGNPaste a game and Stockfish reviews it in your browser: the accuracy of each side, the mistakes and what the engine would have played.
- crop, resize and convertImageDrop or paste an image, crop it, resize it and change its format. The file size shows before you download, and the image never leaves your browser.
- dollar to real, PTAX and remittancesDollarThe commercial rate and the PTAX, with the time of each, and how many reals each service really leaves you for the dollars you are paid.
- scrolling text for concertsLED signYour phone becomes an LED sign to ask for a song at a concert. Full screen, no ads, and it works offline.
- spirit level and inclinometerLevelYour phone becomes a spirit level, lying flat or standing on an edge, to hang a picture or check a floor. In degrees, percent and mm per metre.
Made by Ronaldo Sena, a developer in Uberlândia, Brazil, who also writes about code and chess on the blog.