CSV to JSON Converter

This tool converts CSV data into JSON, turning a table of comma-separated values into a clean array of objects, instantly and in your browser. CSV, or comma-separated values, is the universal format for tabular data: spreadsheets, database exports and reports all speak it, with each line a row and commas separating the columns. JSON, on the other hand, is the format that web applications and APIs prefer, structured as objects with named fields. Moving data from one to the other is a constant task for developers, analysts and anyone wiring systems together, and doing it by hand is tedious and error-prone. This converter does it in one step. You paste your CSV, with the first row as the column headers, and the calculator reads the headers and turns each following row into a JSON object, using the headers as the keys, then assembles them into a neatly formatted array. The result updates as you edit, so you can paste, tweak and copy in seconds. Everything runs locally, so your data is never uploaded, which matters for anything sensitive. Use it to prepare data for an API, to seed a database or test fixtures, to convert a spreadsheet export into a usable structure, or to quickly inspect CSV as JSON. The first line must contain the column names, and each subsequent line becomes one object keyed by those names. This is a straightforward converter that splits on commas, which suits clean, well-formed CSV; data containing commas inside quoted fields is more complex and may need a dedicated library. For everyday CSV, it gives you usable JSON in moments, ready to drop into your code or tools.

-

First row must be the column headers. Splits on commas, suiting clean CSV. Fields containing commas inside quotes need a dedicated parser. Runs in your browser.

How it works

The first line is read as the column headers. Each following line is split on its commas into cells, and a JSON object is built pairing each header with the matching cell. All the objects are collected into an array, which is formatted with indentation so it is easy to read and copy.

Worked example

The CSV with headers name, age, city and two rows for Ava and Ben becomes a JSON array of two objects. The first is name Ava, age 30, city Auckland, and the second is name Ben, age 25, city Wellington, each laid out as an indented JSON object ready to use in code.

Related calculators

If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.

Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.

All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.

Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.

Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.

Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.

All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.

© 2019 to 2026 Calculate.co.nz. All rights reserved.