JSON ⇄ CSV-konverterare
NyttKonvertera en JSON-array till CSV och CSV tillbaka till JSON, med korrekt citering.
Runs entirely in your browser. Nothing is uploaded.
Convert JSON to CSV and CSV to JSON in your browser
This JSON to CSV converter turns a JSON array of objects into a clean, spreadsheet-ready CSV — and converts CSV back into structured JSON — without uploading a thing. Paste your data, drop in a file, or load the sample, then flip the direction toggle to go either way. The result appears live on the right with a preview table, so you can check the columns before you Copy or Download.
It handles the fiddly parts of CSV for you: values that contain commas, quotes, or line breaks are quoted and escaped on the way out, and parsed back correctly on the way in, so your data round-trips between JSON and CSV without corruption.
Flatten nested JSON to CSV
Real-world JSON is rarely flat, and that is where most converters fall over. Switch on Flatten nested and this tool expands nested objects and arrays into dot-notation columns: an address object becomes address.city and address.country, while a roles array becomes roles.0 and roles.1. That lets you flatten nested JSON to CSV in one click instead of writing a script.
Tools like ConvertCSV.com and csvjson.com handle simple flat JSON well but require manual pre-processing for nested structures. Here, you switch one toggle. Prefer to keep a sub-object together? Leave flattening off and each nested value is stored as JSON text inside a single cell, which converts straight back to the original structure when you reverse the direction.
Open your CSV in Excel or Google Sheets
Spreadsheets cannot read JSON directly, but every major spreadsheet app reads CSV without any plugin or conversion step. The fastest path from JSON to Excel is to convert here and open the downloaded file. Pick the comma delimiter for US Excel and Google Sheets, or semicolon for the European locales where Excel expects it by default — Germany, France, the Netherlands, and much of Southern and Eastern Europe — and the columns line up immediately with no Text-to-Columns wizard required. Tab gives you a TSV you can paste straight into a sheet grid.
For Google Sheets, you can also copy the CSV output, open a blank sheet, and paste — Sheets detects the delimiter automatically and splits into columns. If you regularly pull JSON from an API and need it in Sheets, this browser tool is faster than writing a Google Apps Script for one-off jobs. No account needed, no quota to worry about, and the conversion finishes in under a second regardless of how many rows your JSON contains.
Choose your delimiter, headers, and columns
You control the output format. Toggle the header row on or off, switch the delimiter between comma, semicolon, and tab, and use the column chips to include or drop individual fields — handy when an API response returns thirty keys but you only need five. Column order always follows the order keys first appear in your JSON, so the CSV matches exactly what you expect without any alphabetical resorting.
The column chip interface also solves a common pain point: REST API responses often include server-internal fields like _id, __v, or updated_at that you do not want in a customer-facing spreadsheet. Click those chips to exclude them and the preview updates immediately. The selected column set is remembered for the current session, so if you paste updated JSON with the same schema it stays clean. For TSV output, the tab delimiter avoids any quoting conflicts with comma-heavy data like addresses or descriptions — a useful option when piping output to other command-line tools.
CSV to JSON with smart typing
Going the other way, paste or upload a CSV and the tool reads the first row as headers and every following row as an object, handling quoted fields with embedded commas and newlines along the way. The delimiter is auto-detected, and with Parse numbers & booleans on, 42 becomes a number and true becomes a boolean instead of strings, giving you clean, typed CSV to JSON output ready for an API or config file.
This is useful for importing spreadsheet data into a database, building a config file from a shared CSV, or feeding a frontend component that expects a JSON array. The output JSON is formatted with indentation for readability, not minified, so you can inspect it directly. If you need compact JSON for a production API payload, copy the output and minify it with any JSON formatter tool. The conversion handles up to thousands of rows without slowing down because it runs entirely in JavaScript in your browser tab, with no server round-trip adding latency.
How this compares to ConvertCSV, csvjson, and other online converters
ConvertCSV.com is a popular option but uploads your file to its servers, imposes a 1 MB file size limit on the free tier, and shows ads throughout the result page. csvjson.com is clean and developer-friendly but also server-side — your data crosses the network. json-csv.com offers a free tier but limits free conversions per day. Mr. Data Converter is minimal and browser-based but has not been maintained in years and lacks nested flattening.
This tool is fully client-side with no upload, no file-size cap (beyond device memory), no daily conversion limits, and no ads. For sensitive exports — customer records, API responses with personal data, internal analytics — nothing leaves your machine. You can disconnect from the internet after the page loads and keep converting offline. No sign-up, no cost, no compromise on privacy.
JSON vs CSV: hierarchical data versus flat tables
JSON (JavaScript Object Notation), standardised as RFC 8259 in 2017, was designed to represent hierarchical and nested data. An object can contain other objects or arrays to any depth: {"user": {"name": "Alice", "address": {"city": "NYC"}}} is valid JSON that carries structure naturally. This is why JSON became the dominant format for REST APIs, configuration files, and document databases — a single JSON document can encode a complete entity with all its relationships without any join or secondary table.
CSV (Comma-Separated Values), standardised as RFC 4180 in 2005, represents flat tabular data: rows and columns, exactly like a spreadsheet. There is no native concept of nesting. The same user record above cannot fit in a single CSV row without flattening — collapsing the nested address into a top-level column like address_city — or without encoding the nested object as a literal JSON string inside a cell. This fundamental structural difference is why conversion always involves a trade-off: JSON is better for APIs, configuration, and complex hierarchical data; CSV is better for spreadsheet software, bulk database imports, and data analysts who live in Excel or Google Sheets.
The practical implication is that JSON-to-CSV conversion is inherently lossy for anything beyond a flat array of objects. Once a deeply nested document is flattened to CSV, re-hydrating it back to the original structure requires knowing the original schema. For round-trip workflows — read from an API, inspect in a spreadsheet, write back to the API — keeping the JSON as the source of truth and using CSV only as an intermediate view is the safest pattern.
How JSON-to-CSV conversion works under the hood
Converting a JSON array of objects to CSV involves several non-trivial decisions. The first is header generation: because different objects in the same array may have different keys, a correct converter must take the union of all keys across all objects and use that union as the header row. An object missing a key simply gets an empty cell in that column — it is not an error. The second decision is key order: most converters follow first-seen order so the output column sequence is predictable and matches the first object in the array.
The harder problem is flattening nested keys. When an object contains a nested object, the converter must choose a separator for the composed key name: address.city (dot notation), address_city (underscore), or address-city (hyphen) are all common choices. Dot notation is the most widely understood but clashes with property names that already contain dots. Array fields introduce another branching decision: an array like "tags": ["node", "js"] can be handled three ways — stringified as a single cell value node,js, expanded into indexed columns tags.0 and tags.1, or expanded into multiple rows (one row per element, duplicating all other fields). Each approach suits different downstream consumers.
Type preservation is another structural issue. CSV is a string-only format: a JSON number 42 and a JSON string "42" are written identically in CSV. null becomes an empty string; undefined is also omitted as empty. true and false become the literal text true and false. When you convert CSV back to JSON without a type-inference step, every value is a string. The Parse numbers & booleans option in this tool re-applies type inference on the return trip, but if your data has a column that happens to contain only digits and is meant to be a string (a ZIP code like 07001, for example), you need to handle that explicitly — a leading zero in a ZIP code will be dropped if the value is parsed as a number.
CSV format edge cases and RFC 4180
RFC 4180 is a two-page memo, not a full standard, and it leaves enough unspecified to generate real interoperability problems. The most common gotcha is quoting: any field that contains a comma, a double quote, or a line break must be wrapped in double quotes. A double quote inside a quoted field must itself be doubled: the value He said "hello" is written as "He said ""hello""". Converters that do not handle this correctly produce malformed CSV that breaks when imported into Excel or a database. This tool wraps and escapes all such fields automatically on export and parses them correctly on import.
Line endings are another source of inconsistency. RFC 4180 specifies CRLF (\r\n) as the record separator. Many Unix-native tools emit only \n, and most modern parsers accept both — but older Excel versions on Windows expect CRLF and can produce an extra blank row at the end of a file when fed LF-only CSV. The BOM (Byte Order Mark) is a related issue: RFC 4180 does not mention encoding at all, but Excel on Windows historically opens CSV using the system locale encoding (often Windows-1252), which corrupts non-ASCII characters in names, addresses, and currency symbols. Adding the UTF-8 BOM (\xEF\xBB\xBF) as the very first three bytes signals to Excel that the file is UTF-8, preserving all Unicode content. The BOM is invisible in text editors and harmless to every parser that respects UTF-8, but it is the difference between a spreadsheet full of garbled characters and one that displays correctly.
Tab-separated values (TSV) sidestep the quoting-comma problem entirely: because a tab character almost never appears in real data, fields rarely need quoting at all, making TSV easier to generate and parse with simple string-split logic. TSV is common in bioinformatics, data science pipelines, and any workflow where the data itself contains many commas — postal addresses, product descriptions, and free-text fields are prime examples. The delimiter selector in this tool lets you output TSV with one click. One caveat: some TSV consumers do not handle quoted fields or embedded tabs, so treat TSV as the right choice when your data is clean and comma-heavy, not as a universal replacement for CSV.
Frequently asked questions
How do I convert JSON to CSV?
Paste or upload a JSON array of objects, keep the direction on JSON → CSV, and a spreadsheet-ready CSV appears instantly on the right — then Copy or Download it. For example, [{"id":1,"name":"Ada"},{"id":2,"name":"Alan"}] becomes a header row id,name followed by 1,Ada and 2,Alan. Each object becomes one row and each key becomes a column. The entire conversion happens in your browser, so no data leaves your machine and there is no file-size cap imposed by a server.
How do I convert CSV to JSON?
Switch the direction toggle to CSV → JSON (or just upload a .csv file and it flips automatically). The first row is read as column headers and every following row becomes an object, so id,name / 1,Ada / 2,Alan turns into [{"id":"1","name":"Ada"},{"id":"2","name":"Alan"}]. Leave Parse numbers & booleans on to type 1 as a number and true as a boolean instead of strings. The conversion is instant and the output is valid JSON you can paste directly into any API, config file, or code editor.
How do I flatten nested JSON to CSV?
Turn on Flatten nested and any nested objects and arrays get expanded into dot-notation columns. {"name":"Ada","address":{"city":"London"},"roles":["engineer","writer"]} becomes the columns name, address.city, roles.0 and roles.1 — one value per cell. With flattening off, a nested value stays intact as JSON inside its single cell so it round-trips cleanly back to the original structure when you reverse the direction. Most online converters such as ConvertCSV.com do not support nested flattening, requiring you to pre-process the JSON manually first.
How do I convert JSON to Excel?
Convert your JSON to CSV here, download the .csv, then open it in Excel or Google Sheets — both read CSV natively and split it into columns automatically. For European versions of Excel that expect a semicolon delimiter, choose the Semicolon option first so the columns line up without a manual Text-to-Columns step. There is no need for a separate .xlsx export for most data workflows. Google Sheets also accepts CSV imports directly via File → Import. This is the fastest path from raw JSON to a spreadsheet for any volume of data.
How do I convert a large JSON file?
Because the conversion runs entirely in your browser there is no upload and no server-imposed file-size limit — the only ceiling is your device's memory. Multi-megabyte files that online converters like ConvertCSV.com or csvjson.com reject because of upload caps usually work here without issue. Upload the file rather than pasting for the smoothest experience on large inputs. The live preview shows the first 200 rows while the full result remains available to copy or download instantly.
Is it safe to convert JSON and CSV online?
Yes — this converter is 100% client-side. Your JSON and CSV data never leaves your browser: there is no upload, no server, and no logging. Even confidential exports containing personal or business data stay entirely on your device. You can prove this by loading the tool, disconnecting from the internet, and continuing to convert — it keeps working with no network connection at all. Contrast this with ConvertCSV.com, csvjson.com, and similar tools, which require uploading your file to their servers for processing.
How do I convert an array of JSON objects to CSV?
An array of objects is exactly the ideal shape for this converter. The tool takes the union of every object's keys as the column headers, in first-seen order, so rows with missing fields still line up and gaps become empty cells. A single object works too — it is treated as a one-row table. If your objects are wrapped under a property such as {"data":[…]}, paste just the inner array. This handles the most common JSON output format from REST APIs, database exports, and analytics tools.
What delimiter should I use?
Use a comma for standard CSV, US Excel, and Google Sheets. Choose a semicolon for European locales where Excel uses it by default (Germany, France, the Netherlands, and much of Southern and Eastern Europe). Use a tab for TSV files or when you want to paste the output directly into a spreadsheet cell grid. Whichever delimiter you pick, any value that contains that character, a double quote, or a line break is automatically wrapped in double quotes and escaped so the output stays valid and parseable.
Can I convert nested arrays?
Yes. With Flatten nested on, an array is expanded into indexed columns — "tags":["a","b"] becomes tags.0 and tags.1 — so every element gets its own cell in the spreadsheet. With flattening off, the whole array is written as JSON text such as ["a","b"] inside a single cell, which converts cleanly back to a real array when you reverse the direction to CSV → JSON. Both approaches preserve your data without loss; the right choice depends on whether you need each value in its own column or prefer to keep the structure intact.
How do I convert JSON to CSV in Python?
Use the built-in json and csv modules: load the list with json.load(open('data.json')), then use csv.DictWriter(f, fieldnames=rows[0].keys()), call writer.writeheader() and writer.writerows(rows). The pandas shortcut is pd.read_json('data.json').to_csv('data.csv', index=False). For a one-off conversion, this browser tool needs no Python install, no pip, and no virtualenv — and it also flattens nested data automatically, which DictWriter will not do on its own. For automated pipelines or scheduled jobs, Python is better; for ad-hoc work, pasting here is faster.
Why isn't my JSON converting?
Two things to check. First, shape: to produce a table the JSON should be an object or an array of objects. An array of plain values like [1,2,3] still works but collapses into a single value column. Second, syntax: JSON requires double-quoted keys and string values, and no trailing commas. So {name:'Ada',} fails because of the unquoted key and trailing comma, while {"name":"Ada"} works. The red error message below the input box points to the exact line and character position where the parser failed.
How do I keep the column order?
Columns follow the order keys first appear in your JSON and that order is preserved end-to-end through the conversion. So id, name, email stays id, name, email in the output rather than being alphabetized. Use the column chips below the panes to drop or re-include specific fields — handy when an API response returns thirty keys but you only need five. The CSV preview and download both update instantly when you change the column selection, and the remaining columns stay in their original order.
Does this work on iPhone and Android?
Yes — the converter is fully responsive and works in Safari on iPhone, Chrome on Android, and any other modern mobile browser. You can paste JSON directly from your clipboard, or use the file picker to upload a JSON or CSV file from your device's Files app or Downloads folder. The conversion is instant even on mobile because everything runs locally in JavaScript — there is no upload to wait for and no server round-trip. The result can be copied to clipboard or downloaded as a file on any mobile OS.
How do I convert a JSON API response to CSV?
Copy the API response from your browser's Network tab (F12 → Network → click the request → Response) or from a tool like Postman, curl, or Insomnia. Paste it directly into the JSON input here. If the response is wrapped in an envelope like {"data":[...],"status":"ok"}, just paste the inner array portion. The converter handles arrays of any size without needing you to install anything or write a script. For recurring conversions, Python's pandas or jq in a shell script is more repeatable; for a quick one-time job, pasting here takes under ten seconds.
How does this compare to ConvertCSV.com and csvjson.com?
ConvertCSV.com uploads your file to its servers and imposes a 1 MB free-tier cap — useful for small public datasets but a problem for large or sensitive files. csvjson.com is developer-friendly and cleaner but still server-side, which means your data crosses the network. json-csv.com limits free conversions per day. Mr. Data Converter is browser-based but has not been maintained in years and cannot handle nested JSON. This tool is fully client-side with no upload, no size cap beyond device memory, no daily limit, no ads, and no sign-up — your data never leaves your machine.
Related tools
Visa alla verktygMatrix Calculator
Add, subtract, multiply matrices and compute determinant, inverse and transpose for 2×2–4×4 matrices.
XML-formaterare
Försköna, minifiera och validera XML direkt i din webbläsare.
SQL-formaterare
Försköna och minifiera SQL-frågor med nyckelordskasning och klausulbrytningar.
JSON till TypeScript
Generera TypeScript-gränssnitt från ett JSON-exempel, med nästlade typer.
CSV-visare
Visa, sortera och sök i CSV- eller TSV-filer som en ren tabell — i din webbläsare.
Statistics Calculator
Calculate mean, median, mode, standard deviation, variance and more from a data set.