JSON / YAML / XML / CSV Converter
Convert between JSON, YAML, XML, and CSV. Side-by-side editors, auto-detect input, all client-side.
Data Format Converter Tool
How to use the data format converter
Pick the input format
Click JSON, YAML, XML, or CSV above the left pane. Or paste content and the tool will guess based on the first non-whitespace character.
Pick the output format
Click the desired output format above the right pane. The right pane re-renders on every keystroke as you edit the input.
Fix errors as you go
If the input doesn't parse cleanly, a red bar appears below the input box with the parser's error message and line number. The output pane keeps the last successful conversion until the input is valid again.
Copy or download
Copy the output to clipboard or download as a file with the correct extension (.json, .yml, .xml, .csv). The Pretty button toggles between minified and human-formatted output where supported.
JSON, YAML, XML, CSV — picking the right format
Data interchange formats are not interchangeable. JSON dominates web APIs and JavaScript ecosystems. YAML dominates devops config (Kubernetes, Docker Compose, GitHub Actions). XML still rules in older enterprise integrations, financial messaging (FIX, ISO 20022), and document publishing (Word, RSS, Atom). CSV is the universal spreadsheet exchange format despite being technically the worst-defined of the four. Knowing when each is the right choice — and when conversion is lossy — saves hours of integration debugging.
JSON — the default for new code
JSON (ECMA-404, 2013) is the right choice for new APIs, configuration files in JavaScript/TypeScript projects, and any data exchange where machine-parsing matters more than human readability. It's small (no closing tags), unambiguous (every value has exactly one type representation), and supported natively by every modern programming language. The trade-offs: no comments (a real pain for config files), no multi-line strings without escaping, integers are limited to 53-bit precision in JavaScript engines (a problem for Snowflake IDs and 64-bit Bitcoin satoshi values). Use JSON when machines read it more than humans do.
YAML — when humans edit the file
YAML 1.2 (2009) was designed for human-edited configuration. It supports comments, multi-line strings, anchors and aliases (DRY config), and a less-noisy syntax than JSON. It's why Kubernetes manifests, Docker Compose files, GitHub Actions workflows, and Ansible playbooks all use YAML. The cost is parsing complexity — YAML has many edge cases (the "Norway problem" where NO becomes boolean false, leading-zero numbers being octal, types implicitly inferred from value content) that can produce surprising bugs. Use YAML when the file gets edited by hand more than it gets generated by code.
XML — when you can't choose
XML (1998, refined 2008) remains entrenched in financial messaging (SWIFT MX, FIX protocol), document publishing (DOCX, ODT, RSS, Atom feeds), and older enterprise B2B (SOAP web services). Its strengths are namespaces (so XML documents can mix vocabularies from different schemas), attributes vs elements (semantic distinction), and the most-developed schema/validation ecosystem (XSD, DTD, RELAX NG). Its weakness is verbosity — the same data in XML is typically 30-50% larger than JSON. For new code, almost no one chooses XML; for integrating with existing systems that already speak it, XML conversion remains useful.
CSV — the eternal compromise
CSV looks simple — comma-separated values, one row per line — but the simplicity is illusory. Different tools disagree about how to escape commas inside fields (some use double-quoting, some use backslash-escape), how to handle newlines inside fields, whether the first row is headers or data, and what character encoding the file uses (UTF-8 vs Latin-1 vs UTF-8-with-BOM). RFC 4180 (2005) specifies a canonical CSV form but is widely ignored. Excel's CSV export uses CRLF line endings and double-quote escaping; Linux tools usually produce LF endings; semicolons replace commas in some European locales. The tool above outputs RFC 4180-compliant CSV when converting from JSON arrays of objects.
Conversion is lossy
JSON ↔ YAML round-trips losslessly for most data. JSON → XML loses semantic distinction between attributes and elements (the tool picks one convention). XML → JSON loses XML namespaces and the attribute/element distinction. JSON → CSV requires the data to be an array of objects (anything else gets flattened or errors). CSV → JSON makes everything a string (you'll need to retype numbers and booleans yourself). Plan the direction of conversion before designing your data model — going JSON → XML → JSON usually doesn't round-trip cleanly.
10 data-format facts every developer should know
JSON was extracted from JavaScript by Douglas Crockford in 2001 and standardised as RFC 4627 in 2006, ECMA-404 in 2013, and RFC 8259 in 2017 — three formal standards for what looks like a one-page format.
YAML stands for "YAML Ain\'t Markup Language" — a recursive joke. It was designed in 2001 specifically to be human-readable, and remains the dominant config format in devops 25 years later.
The "Norway problem" in YAML: country: NO gets parsed as country: false by YAML 1.1 parsers because NO is interpreted as boolean. YAML 1.2 fixed this; many production tools still use 1.1.
JSON has no comments. This is intentional — Crockford removed them to prevent abuse (annotation-as-directives). Most config-as-JSON tools (VS Code settings, tsconfig) add a "JSONC" extension allowing comments.
XML was extracted from SGML (ISO 8879, 1986) by W3C in 1998. SGML itself was based on IBM\'s GML from 1969 — the lineage goes back to the punch-card era.
CSV has no formal specification until RFC 4180 in 2005 — and even that is "informational" not "standards-track." Every CSV-reading library has its own dialect.
JavaScript\'s JSON.parse() turns integers larger than 2^53 - 1 (~9 quadrillion) into incorrect floats. Bitcoin amounts in satoshis hit this limit; Twitter snowflake IDs do too.
The XML billion-laughs attack: a single 1KB XML document with nested entity references can expand to billions of characters in memory, DoS-ing naive XML parsers. Modern libraries cap entity expansion.
Singapore\'s data.gov.sg exposes datasets in JSON and CSV. Malaysia\'s data.gov.my prefers CSV with Excel-compatible BOM. Indonesia\'s data.go.id uses both with the older Latin-1 encoding in places.
TOML (Tom\'s Obvious, Minimal Language) was designed as a YAML alternative by Tom Preston-Werner (GitHub co-founder) — used by Rust\'s Cargo, Python\'s pyproject.toml. We\'ll add TOML support in a future update.
Frequently asked questions
NO stays as a string, not boolean. If you have a YAML 1.1 file with that bug, the parser will accept it but the converted output may differ from your source system's interpretation.Related News
You may be interested in these recent stories from our newsroom.
-
NEXTDC Opens Peninsular Malaysia's First Tier IV Data Centre with RM2.8 Billion KL1 Launch in Petaling Jaya
NEXTDC officially opened KL1 in Petaling Jaya on 14 May 2026 — an AUD$1 billion facility that holds Peninsular Malaysia's first Uptime Insti...
-
Indonesia's INA Locks In 30% Annual Allocation for AI and Data Centre Infrastructure
Indonesia's sovereign wealth fund INA has formalised a 30% annual cap on digital sector deployment, anchored by a joint venture with Singapo...
-
Microsoft Build 2026: Project Polaris Cuts Copilot's OpenAI Dependency, Copilot Workspace Ships to GA
Microsoft confirmed at Build 2026 in San Francisco that GitHub Copilot will run on Project Polaris — its own mixture-of-experts coding model...
75 more free tools
Calculators, converters, security tools — no signup.