CSV to JSON Converter

Converts a CSV file to JSON format.

Input: TextResult: Structured JSON

Text input

Run to see the result

Examples

Convert a support-ticket export containing commas, quotes and a multiline note

Demonstrate why splitting on commas or newlines corrupts a valid CSV record.

Input

ticketsummarynotes
00123Refund, partialCustomer said "please check" Second line

Download input file

Expected answer

JSON
[
    {
        "ticket": "00123",
        "summary": "Refund, partial",
        "notes": "Customer said \"please check\"\r\nSecond line"
    }
]
Cell delimiters
,
Row delimiters
\r\n
Format
Array of dictionaries
A compact feature-flag record

Input

compactschema
true0

Download input file

Expected answer

JSON
[
    {
        "compact": "true",
        "schema": "0"
    }
]
Cell delimiters
,
Row delimiters
\r\n
Format
Array of dictionaries
A UTF-8 café label

Input

namecity
caféParis

Download input file

Expected answer

JSON
[
    {
        "name": "café",
        "city": "Paris"
    }
]
Cell delimiters
,
Row delimiters
\r\n
Format
Array of dictionaries
A negative sensor reading

Input

stationcelsius
demo-12

Download input file

Expected answer

JSON
[
    {
        "station": "demo",
        "celsius": "-12"
    }
]
Cell delimiters
,
Row delimiters
\r\n
Format
Array of dictionaries
A decimal checkout amount

Input

amountcurrency
12.5EUR

Download input file

Expected answer

JSON
[
    {
        "amount": "12.5",
        "currency": "EUR"
    }
]
Cell delimiters
,
Row delimiters
\r\n
Format
Array of dictionaries
A missing avatar

Input

useravatar
demo

Download input file

Expected answer

JSON
[
    {
        "user": "demo",
        "avatar": ""
    }
]
Cell delimiters
,
Row delimiters
\r\n
Format
Array of dictionaries
Array of arrays

Input

ABCDEF
123456
,;'"
"hello"a"1multi lineend

Download input file

Expected answer

JSON
[
    [
        "A",
        "B",
        "C",
        "D",
        "E",
        "F"
    ],
    [
        "1",
        "2",
        "3",
        "4",
        "5",
        "6"
    ],
    [
        ",",
        ";",
        "'",
        "\"",
        "",
        ""
    ],
    [
        "\"hello\"",
        "a\"1",
        "multi\r\nline",
        "",
        "",
        "end"
    ]
]
Cell delimiters
,
Row delimiters
Format
Array of arrays
Array of dictionaries

Input

ABCDEF
123456
,;'"
"hello"a"1multi lineend

Download input file

Expected answer

JSON
[
    {
        "A": "1",
        "B": "2",
        "C": "3",
        "D": "4",
        "E": "5",
        "F": "6"
    },
    {
        "A": ",",
        "B": ";",
        "C": "'",
        "D": "\"",
        "E": "",
        "F": ""
    },
    {
        "A": "\"hello\"",
        "B": "a\"1",
        "C": "multi\r\nline",
        "D": "",
        "E": "",
        "F": "end"
    }
]
Cell delimiters
,
Row delimiters
Format
Array of dictionaries

Format reference: CSV to JSON background and specification

Related tools

Browse data format tools