PublicSoftTools

Batch File Converter

Convert between JSON, YAML, XML, and CSV formats instantly. Paste your content and download the converted file.

⏱ 9 min read · Complete guide below

Supported Formats

  • JSON — JavaScript Object Notation, ideal for APIs and web applications
  • YAML — Human-readable data serialization, popular in configuration files
  • XML — Markup-based format, common in enterprise and legacy systems
  • CSV — Comma-separated values, universal spreadsheet format

Convert between any two formats instantly. Swap formats with the ⇄ button or choose manually.


Worked Example: JSON to CSV for a Spreadsheet

Suppose an API returns this JSON array of records: [{"name":"Ada","role":"Engineer"}, {"name":"Grace","role":"Admiral"}]. Paste it, set the source to JSON and the target to CSV, and the converter reads the keys of the first object to build a header row, then writes one row per record: name,role / Ada,Engineer / Grace,Admiral. That output pastes straight into Excel or Google Sheets, where each key becomes a column — the fastest way to turn an API response into a spreadsheet.

The reverse works too: paste a CSV with a header row, convert to JSON, and each row becomes an object keyed by the header names — the shape most APIs and JavaScript code expect. Because CSV is flat, it suits arrays of simple records best; deeply nested JSON gets flattened when forced into rows and columns, so for hierarchical config data prefer JSON↔YAML, which preserves the structure exactly.

Choosing the Right Format for the Job

Each of the four formats has a home turf. JSON is the lingua franca of web APIs and JavaScript — compact, unambiguous, and parsed natively by every language. YAML shares JSON's data model but trades braces for indentation, making it far more pleasant for humans to read and edit, which is why it dominates configuration for tools like Docker Compose, Kubernetes, and CI pipelines. XML is more verbose but supports attributes, namespaces, and schemas, and it is still entrenched in enterprise systems, document formats, and older APIs. CSV is the universal spreadsheet format — flat, simple, and openable by Excel, Google Sheets, and every data tool. Knowing which format a downstream system expects is half the battle; converting to it is the other half.

Flat vs Hierarchical: The Key Trade-off

The most important thing to understand before converting is that CSV is flat while JSON, YAML, and XML are hierarchical. A CSV is a grid of rows and columns with no concept of nesting, so it maps perfectly to an array of simple records — a list of users, transactions, or products where each has the same set of plain fields. The moment your data contains objects inside objects, or arrays inside records, forcing it into CSV means flattening or serialising those nested parts into single cells, which loses the clean structure. So convert to CSV when your goal is a spreadsheet of flat records, and stay within JSON, YAML, or XML when you need to preserve a nested shape.

Converting Config Files Safely

A very common use of this tool is moving configuration between JSON and YAML — for example, turning a hand-written YAML config into the JSON some tools require, or the reverse for readability. Because the two share the same underlying data model, that conversion is lossless for standard values. The one thing to watch is that the input is valid: a single mis-indented line in YAML or a stray trailing comma in JSON will cause the conversion to fail or produce something unexpected. Since everything runs locally in your browser and nothing is uploaded, it is safe to convert configs that contain secrets or internal details — but always validate the source syntax first, and review the output before deploying it.

How Each Format Represents Data Types

Converting cleanly between formats requires understanding that they do not all agree on data types, and the differences cause most conversion surprises. JSON has a small, strict set of types: strings, numbers, booleans, null, arrays, and objects. YAML shares that model but is looser about how values are written, which is both a convenience and a trap. XML, by contrast, has essentially one type — text — so numbers and booleans are just strings unless a schema says otherwise, and structure is expressed through nested tags and attributes. CSV is the most limited of all: every value is plain text in a cell, with no native notion of number, boolean, or null.

This is why a round trip can subtly change your data. A boolean true in JSON becomes the string "true" when pushed through CSV or XML, and a number may lose its type distinction. For most everyday conversions this does not matter, but when a downstream system is strict about types — an API that rejects a string where it expects a number — it is worth checking the output rather than assuming a perfect translation.

Common Pitfalls When Converting Between Formats

A handful of recurring issues account for most failed or surprising conversions. The first is invalid source syntax: a missing bracket or trailing comma in JSON, an unclosed tag in XML, or inconsistent indentation in YAML will stop a conversion cold, so validating the input first saves frustration. The second is CSV quoting: fields that contain commas, quotes, or line breaks must be wrapped in double quotes, with internal quotes doubled — a well-formed CSV handles this automatically, but hand-edited CSV often does not, producing misaligned columns.

YAML deserves special caution because its flexibility hides traps. The famous “Norway problem” is a good example: unquoted values like no, yes, on, and off can be interpreted as booleans, so a country code NO or a version string can turn into false unexpectedly. Quoting values you intend as strings avoids this. Across all formats, the golden rule is the same: validate the input, convert, and then review the outputbefore relying on it, rather than trusting the transformation blindly.

Where Format Conversion Fits in a Workflow

Format conversion is rarely the goal in itself — it is the glue between systems that each speak a different dialect. A typical case is turning an API response (JSON) into a spreadsheet (CSV) so a non-technical colleague can filter and sort it in Excel. Another is converting a hand-written YAML config into the JSON that a particular tool or validator requires, then back again for human editing. Data teams often convert between formats when moving records between a web API, a database import that wants CSV, and a config-driven pipeline that wants YAML.

Because this converter runs entirely in your browser with nothing uploaded, it fits safely into these workflows even when the data is sensitive — configuration containing secrets, internal API output, or personal records never leave your device. For one-off and interactive conversions it is faster than writing a script, and for anything you will repeat many times, understanding the type and quoting caveats above helps you decide when a quick paste-and-convert is enough and when a dedicated, tested script is the more robust choice.

Frequently Asked Questions

Which formats can I convert between?

JSON, YAML, XML, and CSV — any format to any other. Common conversions include JSON to CSV (for spreadsheets), YAML to JSON (for tooling that needs JSON), CSV to JSON (for APIs), and JSON to XML (for legacy systems).

Is my data uploaded to a server?

No. All conversion runs entirely in your browser using JavaScript. Your content — which may include configuration secrets, API data, or personal records — never leaves your device and is not logged or stored.

How does CSV conversion handle nested data?

CSV is a flat, tabular format with no concept of nesting, while JSON, YAML, and XML are hierarchical. When converting a nested structure to CSV, only the top level of records maps cleanly to rows and columns. Deeply nested objects are flattened or serialized into a single cell, so CSV is best suited to arrays of flat records.

Why did my conversion fail or produce unexpected output?

The most common cause is invalid input syntax — a missing bracket in JSON, inconsistent indentation in YAML, or an unclosed tag in XML. Validate your source first. Also note that CSV assumes the first row is a header; if your CSV lacks headers, the converted keys will be the first data row.

Is there a file size limit?

There is no hard limit because processing happens in your browser memory. Files up to several megabytes convert near-instantly. Very large files (tens of MB) may briefly freeze the tab while processing, since the work runs on the main thread.

What is the difference between JSON and YAML?

They represent the same data model — objects, arrays, strings, numbers, booleans — but with different syntax. JSON uses braces and quotes and is compact and machine-friendly. YAML uses indentation and is more human-readable, which is why it dominates configuration files (Docker Compose, Kubernetes, CI pipelines). Converting between them is lossless for standard data.

How is XML different from JSON?

Both represent structured data, but XML is a markup language using opening and closing tags, while JSON uses a lightweight syntax of braces, brackets, and key-value pairs. XML supports attributes, namespaces, and schema validation, which makes it powerful but verbose; JSON is more compact and maps directly onto the data structures of most programming languages. JSON has become the default for web APIs, while XML remains common in enterprise, document, and legacy systems.

Can I convert a CSV that contains commas or quotes inside a field?

Yes. Proper CSV handles this by wrapping any field that contains a comma, quote, or line break in double quotes, and doubling any literal quotes inside. A well-formed CSV converts correctly. Problems usually arise from malformed CSV where these rules were not followed — for instance a comma inside an unquoted field. If your conversion looks misaligned, check that the source CSV quotes fields containing special characters.

Does the first row of my CSV need to be a header?

Yes, this converter treats the first row of a CSV as the header row, and those values become the keys when converting to JSON, YAML, or XML. If your CSV has no header and the first line is actually data, the converted keys will be that first data row, which is usually not what you want. Add a header row with meaningful column names before converting for the cleanest results.

Features

Multiple Formats

JSON, YAML, XML, and CSV. Convert between any two formats.

Copy & Download

Copy converted text or download as a file instantly.

No Upload

All conversion happens in your browser. No server upload needed.

Instant Results

Fast conversion with instant visual feedback.