Ready to Execute
Click the blue ▶ Run button in the header bar or press Ctrl + Enter to compile and preview your results.
YAML and the Norway Problem (Why 'no' Becomes false)
A country list containing NO for Norway becomes a list containing false
About YAML Formatter — Free Online Tool
YAML Formatter re-indents through a real parser and flags the scalars that YAML 1.1 and 1.2 disagree about — the Norway problem, version numbers, leading zeros and time-like values.
Parses, re-serialises at your chosen indent, and separately scans the SOURCE text for ambiguous scalars, because those traps are about what a DIFFERENT parser would do with the same file.
Parsing and re-emission happen in memory on this page. The document is never transmitted.
Tidying a CI config or Kubernetes manifest, finding why a value arrives as the wrong type, normalising indentation before a diff, and catching a duplicate key.
Also known as: yaml beautifier
When to use it
Because the hard part of YAML is not the indentation. It is that a value which looks obviously like a string is sometimes a boolean, a number, or a sexagesimal integer, depending on which parser reads it.
How it works
The document is parsed, re-serialised with your indent, and the original text is scanned for the five classes of ambiguous scalar.
The Norway Problem Is Still Live
YAML 1.1 reads y, yes, n, no, on and off as booleans. YAML 1.2 reads them as strings. So a country list containing NO for Norway becomes a list containing `false` under one parser and "no" under another — and both parsers are correct for the version they implement. A great deal of tooling is still on 1.1, which is why this is a live problem in 2026 and not a historical curiosity. The fix is to quote them, and this formatter quotes them on the way out.
The Trap It Cannot Fix
An unquoted number is already damaged by the time it reaches the formatter. `version: 1.10` is parsed as the float 1.1, and the trailing zero is gone before any re-serialisation could preserve it; `perms: 0755` is read as octal 493; `window: 22:22` is read as the sexagesimal integer 1342. These are reported as warnings rather than quietly corrected, because correcting them would mean guessing what you meant. Quote them in the source.
Tabs And Duplicate Keys
YAML forbids tabs for indentation outright, and this is the commonest reason a file that looks right will not parse — an editor renders a tab and four spaces identically. A duplicate key is also an error, but many parsers silently keep the LAST one, which is how an edit at the top of a file is overridden by a forgotten copy two hundred lines down. Both are caught here with an explanation rather than a parser message.
What A Round Trip Loses
This is a round trip through a parser, not a text tidy-up: the file is loaded into a data structure and written back out. So comments do not survive, blank lines do not survive, and the original key order survives only because nothing reordered it. That is a property of YAML round-tripping in general and not a fault here — but it means this is a formatter to run on a file you can review, not a filter to run blind in a pipeline over a commented config.
How to Use YAML Formatter in 4 Easy Steps
Follow this simple guide to process your files in seconds directly inside your browser tab.
Provide Input for YAML Formatter
Paste your payload, code snippet, or string into the YAML Formatter editor workspace. A formatter that loads YAML into a data structure and writes it back out at a consistent indent, while separately checking the source for values that different parsers read differently.
Configure Formatting & Validation Rules
Select indentation preferences, minification, encoding options, or validation rules. Because the hard part of YAML is not the indentation. It is that a value which looks obviously like a string is sometimes a boolean, a number, or a sexagesimal integer, depending on which parser reads it.
Run In-Browser Engine
The engine executes YAML Formatter locally in your browser with microsecond latency and zero server transmission.
Copy or Download Output
Copy the sanitized, formatted, or generated output directly to your clipboard or download it for your project.
Why Use YAML Formatter on ShortTrick
Engineered for maximum speed, strict privacy, and frictionless digital productivity.
Zero Code or Token Leaks
Proprietary source code, API keys, database queries, and tokens processed in YAML Formatter never leave your browser.
Microsecond Performance
Optimized AST parsers and Web Crypto APIs process large payloads in YAML Formatter in milliseconds.
Syntax Validation & Formatting
YAML Formatter highlights syntax errors and enforces standard formatting conventions automatically.
Offline Ready
Once loaded, YAML Formatter functions entirely offline without requiring an active internet connection.
Frequently Asked Questions About YAML Formatter
Common questions regarding YAML Formatter, data privacy, file format compatibility, and usage limits.
Popular Searches & Related Tasks for YAML Formatter
Common search phrases, secondary format tasks, and workflows users reach for when using this tool.
Direct Variations & Search Synonyms (8)
Specific Workflows & Long-Tail Queries (15)
Semantic Standards & Technical Entities (20)
Minify, format and validate are three different operations
All three take code in and give code back, which is why they get used interchangeably. Only one of them is meant for the file you ship, only one is meant for the file you read, and the third never changes a byte.
| Operation | Changes the file? | Output is for | Reversible |
|---|---|---|---|
| Minify | Yes, removes whitespace and comments | The browser | Format it again |
| Format / beautify | Yes, adds whitespace | A human and a diff | Minify it again |
| Validate | No | Finding the error | Nothing to reverse |
In practice: Minify what you deploy, format what you commit, validate when something will not parse. Two cautions: minifying strips comments, so a licence header disappears unless it is marked to keep; and in HTML, whitespace between inline elements is not decoration, so a minifier that collapses it can visibly close up gaps between words and links.
Related Developer Tools Tools & Popular Utilities
Explore complementary browser-based tools with zero file uploads and instant in-memory execution.
More Developer Tools Tools
Popular Tools Across Other Categories
Related Reading & Tutorials
Guides, articles, and best practices for developer tools workflows.
