Papa Parse CSV to JSON: What Developers Get
Docify's CSV to JSON page is a thin browser wrapper around Papa Parse on a string: header: true, skipEmptyLines: true, dynamicTyping: true. Upload uses FileReader.readAsText for .csv / .txt. Any Papa error blocks JSON. It is not Excel and not JSON-to-CSV. Nothing is uploaded.
Use this when you already have a text table and want objects in the clipboard. It is not a pipeline, not a typed schema, and not a fixture generator with overrides. The live converter matches the options in how CSV rows become JSON objects.
What the page will not do
No Excel or XLSX
The picker accepts .csv and .txt only. A workbook is not parsed. Export CSV from the spreadsheet first, then paste or upload that text.
No JSON → CSV
Papa.unparse is unused. There is no reverse converter, no delimiter picker, and no “download as CSV” on the JSON card.
Errors block the output
If result.errors is non-empty (TooFewFields, TooManyFields, and the rest of Papa’s messages), the page concatenates those messages and leaves the JSON box unchanged. Partial rows are not written.
File read vs parse
Upload is FileReader.readAsText into the CSV textarea. Convert then calls Papa.parse on that string. That is why a huge file still has to sit in the box, and why encoding is whatever the browser’s text reader used — there is no encoding dropdown. Encoding a value for a query string is a different tool: the URL encoder.
Download and copy
Success is JSON.stringify(result.data, null, 2). Download saves that as converted.json with type application/json. Copy uses navigator.clipboard.writeText. For the sample rows and the Convert button, see CSV to JSON with Papa Parse.
Convert CSV in the browser
String parse only. Errors block JSON. Not Excel and not unparse.
Use CSV to JSON →FAQ
- Can I convert Excel files or JSON back to CSV?
- No. Upload accepts .csv and .txt and reads them with FileReader.readAsText. There is no XLS/XLSX parser, and this page does not call Papa.unparse, so it does not turn JSON back into CSV.
- Does upload call Papa.parse on the File object?
- No. The file picker fills the CSV textarea with FileReader.readAsText. Convert then parses that string. Papa.parse(file) is not used.
- What happens if a row has the wrong number of fields?
- If Papa reports any errors (for example TooFewFields or TooManyFields), the page shows those messages and does not write JSON — even when some rows parsed. There is no partial-output mode.
- What MIME type is the download?
- Download JSON writes the pretty-printed string as application/json and names the file converted.json. Copy writes the same string to the clipboard. Neither is a streaming export.