Loading a spreadsheet export into an API
Finance and ops hand over CSV; the endpoint wants JSON. Converting at the boundary avoids writing a throwaway parser for a one-off import.
Parses CSV rows — including quoted fields, embedded commas and newlines — into JSON.
—Parses CSV rows — including quoted fields, embedded commas and newlines — into JSON.
name,note Ada,"said ""hello"", world"
[{"name":"Ada","note":"said \"hello\", world"}]Quoted fields with commas and escaped quotes parse correctly.
The JSON preserves the exact field values from the CSV.
Your input is sent to YAS infrastructure because the tool requires server-side processing or public network queries. Input is not stored.
curl -X POST "https://yas.sh/api/v1/tools/csv-to-json" \
-H "Content-Type: application/json" \
-d '{"input":"name,age\nAnna,30\nBob,25"}'const res = await fetch("https://yas.sh/api/v1/tools/csv-to-json", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"input": "name,age\nAnna,30\nBob,25"
}),
});
const data = await res.json();import requests
r = requests.post("https://yas.sh/api/v1/tools/csv-to-json", json={"input":"name,age\nAnna,30\nBob,25"})
data = r.json()| Field | Type | Required | Description |
|---|---|---|---|
| input | string | Yes | CSV text (≤ 64 KB, ≤ 5,000 rows) |
| delimiter | string | No (default ",") | Field delimiter |
| hasHeader | boolean | No (default true) | First row = keys |
{ "result": { "rows": [{ "name": "Anna", "age": "30" }], "count": 2, "columns": ["name", "age"] } }Parse CSV (quoted fields, headers) into a JSON array.
400 VALIDATION_ERROR — invalid input or unsupported option.413 PAYLOAD_TOO_LARGE — input exceeds the 64 KB limit.429 RATE_LIMIT_EXCEEDED — rate limit exceeded (60 req/min).Parsing follows RFC 4180: fields are separated by commas, records by line breaks, and any field containing a comma, a quote or a newline must be wrapped in double quotes with embedded quotes doubled. A correct parser is therefore a small state machine, not a line-splitter — splitting on commas breaks the moment a quoted address field contains one, which is why hand-rolled CSV parsing fails on real data.
The first row is treated as a header and becomes the object keys, with each subsequent record emitted as one object. Everything in CSV is text: there are no types in the format, so numeric-looking and boolean-looking values are inferred, and any inference rule will be wrong for some column — leading-zero postcodes, phone numbers and version strings being the usual casualties.
Finance and ops hand over CSV; the endpoint wants JSON. Converting at the boundary avoids writing a throwaway parser for a one-off import.
Converting a sample lets you see the actual field names and value shapes, including the trailing spaces and inconsistent casing that break imports downstream.
A JSON array of objects drops straight into test fixtures, database seeds or mock API responses.
Charting and table libraries expect arrays of objects. Converting once server-side avoids parsing CSV in the browser on every page load.
What this tool deliberately does not do, and where it will disagree with other implementations.