Data Formatter
One workbench for the four data formats you paste all day: pretty-print, validate with line-precise errors, or minify — without uploading anything.
Work here
Processed on your device. Input is never uploaded or saved.
Your result
How to use Data Formatter
- Enter your own input or try the example above.
- Choose the mode that matches your task. Results update as you edit; random generators run only when you choose Generate.
- Review the result, then copy or download it. Closing this tab discards the input.
Auto-detect, then override
Auto-detect looks at the first meaningful characters: < means XML, { or [ means JSON, key: lines mean YAML, and delimiter-rich lines mean CSV. If a file is ambiguous — a single-column CSV, say — pick the format explicitly and the tool will never second-guess you.
What validation checks (and what it does not)
Validation checks structure: JSON must parse, XML must be well-formed with one root and matching tags, CSV rows must share one width, YAML maps and lists must nest cleanly. It is not schema validation — there is no JSON Schema, XSD or DTD checking — so a valid file can still be wrong for your API.
YAML scope, honestly
The YAML engine covers the everyday core: block mappings, sequences, nested structures, comments, and plain, single- and double-quoted scalars. Anchors, tags, flow collections on input and | or > block scalars are flagged with a clear message instead of being silently misread. Minified YAML is emitted as valid single-line flow style.
Formatting changes whitespace, not data
JSON and YAML round-trip through a real parser, so formatting never alters values (sorting keys is opt-in). XML pretty-printing normalises indentation and trims text edges, which can matter in mixed-content documents — review before shipping. CSV formatting quotes every field uniformly; minifying quotes only fields that need it. Everything runs locally in your browser.