Форматируйте и валидируйте JSON
Размер
0 KB
Строк
0
Статус
✓
Tool guide
API responses, webhook bodies and config strings pulled out of an environment variable usually arrive as one unbroken line, and a missing comma or a stray closing brace is invisible in that shape. This page parses what you paste with the browser's own JSON parser, prints it indented level by level, and on failure reports the character position where parsing stopped. The payload never leaves the tab, so a response carrying customer data is safe to inspect here. See also: rewrite the checked JSON as a YAML config, view the array as a readable table, the same pretty printing for an XML file.
Paste the string and press Format. Parsing halts at the first violation and names the character position, so you can count to it in the source. Three causes account for most failures: a comma before a closing bracket, single quotes instead of double ones, and a response truncated during copy. Fix one, format again, and the next problem shows up immediately.
Because that is not JSON. The format allows no comments, no trailing commas and no single quotes around keys or strings. Those are JSON5 and JSONC extensions that editors like VS Code accept but a standard parser does not. If the text came out of a tsconfig or an ESLint config, strip the comments before pasting.
A few hundred kilobytes parse and print almost instantly. A multi-megabyte database dump is a bad idea: the raw string, the parsed object and the formatted output all sit in tab memory at once and the browser stalls. For that size use a command line tool and bring a single record or one branch of the document here.
Indentation and line breaks are extra bytes in every request and every log line. A compact string is shorter and easier to handle in a POST body, in an environment variable or in a config field. Machines do not need readability, so the usual cycle is expand to understand, collapse to send.
Key order inside an object survives exactly as it appeared in the source. Numbers have a catch: very long integers such as Telegram ids or snowflake keys lose precision on parse, because JavaScript stores every number as a double. If those values matter, carry them as strings instead.
Yes — both boxes are plain text areas that behave normally in a mobile browser and the buttons are tap sized. The catch is scrolling: long lines are painful on a small screen, and pasting a big response out of a messenger sometimes gets clipped by the system clipboard. A desktop is more comfortable for a large payload.
Nowhere beyond the tab. Parsing and printing are done by the page's own script, and it issues no network request carrying the field contents. A response holding customer addresses or order numbers can be made readable without handing it to a third-party service. The boxes are empty after a reload, so copy the result out right away.
Before: {"order":{"id":10428,"sum":4290,"items":["router","cable"]}} After: { "order": { "id": 10428, "sum": 4290, "items": [ "router", "cable" ] } } Before: {"host": "db.local", "port": 5432,} After: Parse error: unexpected } — remove the comma that follows 5432
Your rating and feedback help decide what to improve next.