JSON / YAML / TOML / CSV / XML / HTML / Markdown Converter
Convert data between JSON, YAML, TOML, CSV, XML, HTML, Markdown, and .env without installing CLI tools or writing a script. Paste your configuration file, API response, or data structure, choose a target format, and get the converted output instantly. Everything runs in your browser.
What is a Data Format Converter?
A data format converter transforms structured data from one serialization format to another while preserving the data’s meaning and hierarchy. Common formats include JSON (the default for APIs and data interchange), YAML (preferred for DevOps configs like Kubernetes and Docker Compose), TOML (used in Cargo.toml and pyproject.toml), CSV (tabular data), XML (enterprise systems and document formats), HTML (web content), Markdown (documentation and READMEs), and .env (environment secrets). Each format has tradeoffs. Converting between these formats is a routine task when moving configuration between tools, sharing data across teams, or migrating systems.
How to Use
- Select the input format using the From buttons (JSON, YAML, TOML, CSV, XML, HTML, Markdown, or .env), or click Detect to identify the format automatically
- Select the target format using the To buttons
- Paste or type your data in the input panel. The output updates as you type
- Adjust indentation with the indent selector (2 or 4 spaces) for JSON and YAML output
- Click Copy to grab the result, or use Swap to reverse the conversion direction
Why These Formats Exist
JSON became the universal data interchange format because it maps directly to the data structures in most programming languages: objects, arrays, strings, numbers, booleans, and null. Its rigidity (no comments, strict quoting, mandatory commas) is a feature for machine parsing and a pain point for human editing.
YAML was created as a human friendly data serialization language. Indentation based nesting, bare strings, comments, and multiline values make it natural for configuration files. That flexibility comes with complexity: YAML has type coercion rules that surprise experienced developers (the Norway problem, where the country code NO parses as boolean false), and whitespace sensitivity means a single misplaced space can silently change your data structure.
TOML was explicitly designed to be a minimal configuration file format that is easy to read because of its obvious semantics. It uses INI file style section headers with strict typing. TOML works well for flat to moderately nested configs but becomes verbose for deeply nested data because every level needs a full dotted key path or table header.
CSV is the standard for tabular data: rows of records with comma-separated fields. It is universally supported by spreadsheets, databases, and data analysis tools. CSV cannot represent nested structures, so converting nested JSON to CSV requires flattening. This tool requires a header row and at least one data row.
XML predates JSON and remains the backbone of enterprise systems, SOAP APIs, document formats (HTML, SVG, RSS), and Java/Android configuration. It supports attributes, namespaces, and schema validation (XSD). XML is verbose but extremely flexible. Convert JSON to XML when integrating with legacy systems or when you need document-level structure.
HTML is the markup language for web content. It uses tags to define structure and presentation. Converting Markdown to HTML produces web-ready content. Converting HTML to Markdown strips formatting to produce clean, portable text.
Markdown is a lightweight syntax for writing formatted text. It is the standard for README files, documentation, blog posts, and note-taking apps. Converting HTML to Markdown is useful for extracting content from web pages into portable documents.
.env files are the standard for environment-specific configuration. They use simple KEY=VALUE syntax, support comments, and are loaded by applications at runtime. Docker, Vercel, Netlify, and most deployment platforms read .env files to inject secrets and settings without committing them to version control. Try the ENV to JSON example to convert a sample .env file with nested keys and comments.
Understanding the tradeoffs helps you pick the right format: JSON for APIs and serialization, YAML for complex DevOps configurations, TOML for application settings, CSV for tabular data, XML for enterprise systems, HTML for web content, Markdown for documentation, and .env for environment secrets.
Need to format or validate JSON before converting? Use the JSON Formatter. Working with SQL or CSS configs? The Code Formatter handles those languages.