JSON ↔ YAML Converter
Move structured data between JSON and YAML without rounding numeric text. Edit the source, review conversion notes and export the result.
JSON input
0 UTF-8 bytesUp to 1,000,000 UTF-16 text units. Open UTF-8 source files up to 2 MiB. Your input is kept when a conversion fails.
YAML output
0 UTF-8 bytesNo result yet.
Conversion notes
- Convert data to see its notes.
Types, anchors & compatibility
YAML 1.2 core rules keep yes, no, on, off and ordinary date strings as strings. Only string mapping keys are supported. Duplicate keys, custom tags, recursive aliases, Infinity, NaN and multiple YAML documents receive errors.
Anchors and aliases are expanded into independent JSON values, up to 100 expanded references and 50,000 values. Under core schema rules, << is a literal key; merge-key behavior is not applied.
JSON → YAML quotes strings and keys to preserve their types and keeps numeric literals. YAML → JSON retains exact decimal digits and converts hexadecimal/octal integers to decimal. Other applications may round numbers when parsing the downloaded data.
YAML comments, anchor names and formatting are omitted during data conversion. The output is a data representation; check it in the application that will use it.
No source is uploaded or saved automatically. Up to 100 nested containers and 4,000,000 output text units; numeric literals up to 10,000 characters. Powered by locally served yaml 2.9.1 · open-source license.
Using JSON ↔ YAML Converter
Convert JSON and YAML locally with exact numeric source text, clear type rules and readable output.
- Choose JSON to YAML or YAML to JSON. Paste source, open a UTF-8 file up to 2 MiB or try an example. Input is limited to 1,000,000 UTF-16 text units.
- Choose 2-space or 4-space output, or compact JSON. YAML always uses at least 2 spaces. Click Convert.
- Read conversion notes about quoted strings, omitted comments and expanded aliases. Correct any duplicate keys, unsupported types or parse errors.
- Copy or download the result. Use result as input to convert in the other direction, with Undo available to restore the previous source.
Example
JSON {"id":12345678901234567890,"enabled":true,"label":"yes"} becomes YAML with the same numeric digits and a quoted yes string.
YAML anchors can be expanded into repeated JSON values; the output notes explain that anchor names and comments are omitted.Questions & answers
Is source data uploaded or saved?
No. A local browser worker parses and converts the source using libraries served by this website. Source and results are not uploaded or saved automatically.
Are large integers and decimals rounded?
The converter retains exact numeric source text instead of passing it through ordinary JavaScript number serialization. YAML hexadecimal and octal integers become exact decimal digits. Other applications can still round numbers when they parse the result.
Which YAML version is supported?
One YAML 1.2 document using core schema rules. In these rules, yes, no, on, off and ordinary dates are strings. YAML 1.1 directives and multiple documents receive errors rather than silent type changes.
Why are strings and keys quoted in YAML output?
JSON to YAML uses double quotes for strings and keys to preserve their types. Text such as yes, 0012, null or a date remains text rather than becoming a boolean, number or null in compatible parsers.
What happens to anchors and aliases?
Supported aliases expand into independent JSON values. Anchor names are omitted and the result includes a note. Recursive aliases, unknown anchors or more than 100 expanded references receive errors.
Are merge keys supported?
Under this tool’s YAML 1.2 core schema, << is a literal string key. Merge-key behavior is not applied. A note appears when this key is present so you can check the target application’s expectations.
What happens to comments and formatting?
Conversion keeps the data representation. YAML comments, anchor names and source formatting are omitted. JSON cannot represent comments. The result uses the chosen indentation and preserves property order.
Why do some YAML values receive errors?
JSON requires string object keys and cannot represent Infinity, NaN, custom YAML tags or recursive references. Duplicate keys are also rejected. Quote keys or replace incompatible values with suitable strings, finite numbers or null.
Can I open files and reverse a conversion?
Yes. Open UTF-8 JSON, YAML or text files up to 2 MiB; .json and .yaml/.yml extensions choose the direction. Use result as input switches direction, and Undo restores the previous source.
What limits apply?
Input is limited to 1,000,000 UTF-16 text units, output to 4,000,000, nesting to 100 containers, expanded values to 50,000, expanded aliases to 100 and numeric literals to 10,000 characters. Conversion has an 8-second worker timeout; file reading has a 30-second timeout.
Guides for this tool
Examples and checks to help with your next step.
Help improve this tool
Report a problem or suggest an improvement
Describe the issue without pasting private tool input. Feedback goes to our admin inbox.
