Universal File Formatter

Format code or text files using Prettier. Supports JSON, JS, HTML, CSS, Markdown, YAML.

Input
Output

Powered by Prettier

About the multi-format File Formatter

Real-world files do not always come in the format you expect. A developer might receive a config blob and not know whether it is JSON, YAML, TOML, or XML until they squint at it. This tool auto-detects the format of any text payload and pretty-prints it consistently, falling back to plain-text formatting (consistent indentation and line endings) if it cannot identify the structure.

The formatter works entirely in the browser and supports JSON, YAML, XML, TOML, INI, and a handful of other small data formats. It is intended as a "do something useful with this text" first stop before deciding which more specific tool to reach for.

How to use

  1. Paste the text into the input.
  2. The detected format appears in the corner. Override it manually if the auto-detection misfires.
  3. Read the formatted output. Errors include the line where parsing failed.
  4. Copy the result, or click "Open in specialised tool" to switch to the dedicated JSON/YAML/SQL formatter.

Common use cases

  • Identifying mystery configuration blobs from log lines.
  • Pretty-printing exports from legacy systems that emit XML or INI.
  • Combining multiple format-specific cleanups into a single pasteboard.

Frequently asked questions

How is the format detected?

The tool tries each parser in order of strictness — JSON first, then TOML, then YAML, then XML — and uses the result of the first one that succeeds.

Can I disable auto-detection?

Yes — pick the format manually from the dropdown to skip detection.

Advertisement