<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[JSON2CSV Blog]]></title><description><![CDATA[JSON2CSV Blog]]></description><link>https://json2csv.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6b0abbf3660acb2302095ab0/a9f01ff1-1bff-4604-a950-2db949578e43.png</url><title>JSON2CSV Blog</title><link>https://json2csv.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 23:06:02 GMT</lastBuildDate><atom:link href="https://json2csv.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Why Excel Breaks Your JSON-to-CSV Conversions (and How to Stop It)]]></title><description><![CDATA[Excel cuts long IDs to 15 digits, drops leading zeros and garbles accents. Learn why a correct CSV looks wrong in Excel, and how to fix each case.]]></description><link>https://json2csv.hashnode.dev/why-excel-breaks-your-json-to-csv-conversions-and-how-to-stop-it</link><guid isPermaLink="true">https://json2csv.hashnode.dev/why-excel-breaks-your-json-to-csv-conversions-and-how-to-stop-it</guid><category><![CDATA[json]]></category><category><![CDATA[json-schema]]></category><category><![CDATA[csv]]></category><category><![CDATA[csv to excel]]></category><category><![CDATA[CSV export]]></category><category><![CDATA[CSV Converter]]></category><category><![CDATA[json to csv]]></category><dc:creator><![CDATA[JSON2CSV]]></dc:creator><pubDate>Sat, 28 Nov 2026 11:44:16 GMT</pubDate><content:encoded><![CDATA[<p>Someone sends you a CSV, you open it in Excel, and half the IDs are wrong. It is easy to blame the tool that made the file. Most of the time the file is fine, and Excel changed the data when it opened it.</p>
<p>I ran into this often enough that I built a browser-based converter that avoids these traps. This post is about the traps themselves, because you will meet them whichever tool you use.</p>
<h2>1. Excel keeps only 15 digits</h2>
<p>Excel stores numbers as 64-bit floating point, so it shows 15 significant digits and replaces the rest with zeros. A 19-digit order ID like <code>1234567890123456789</code> opens as <code>1234567890123450000</code>. The CSV still holds the right value, but if you save from Excel, you overwrite it.</p>
<p><strong>What to do:</strong> treat IDs as text, never as numbers. CSV cannot mark a column as text, so either import through <strong>Data &gt; From Text/CSV</strong> and set the column type to Text, or export to <code>.xlsx</code>, where the cell type is stored.</p>
<p>JSON has a similar problem one step earlier. <code>JSON.parse</code> in JavaScript also uses 64-bit floats, so an integer above 9007199254740991 is rounded before your code sees it. If your IDs are that large, ask the API to send them as strings, or use a parser that keeps the original digits.</p>
<h2>2. Leading zeros disappear</h2>
<p>A zip code like <code>02134</code> becomes <code>2134</code>, and phone numbers lose their leading zero. The cause is the same: Excel decides the column is numeric and drops the zero. The fix is the same too: import as text.</p>
<h2>3. Accents turn into garbage</h2>
<p>If <code>Müller</code> appears as <code>MÃ¼ller</code>, the CSV is UTF-8 but Excel opened it as a legacy Windows encoding. Writing the file with a UTF-8 byte order mark (BOM) fixes it, because Excel then detects the encoding. In Python that is <code>encoding="utf-8-sig"</code>.</p>
<p><strong>A different case: Chinese files.</strong> Files from Chinese suppliers and older systems are often saved as GBK or GB2312, not UTF-8. A BOM does not help, because the file is not UTF-8. Open it through <strong>Data &gt; From Text/CSV</strong> and set the file origin to Chinese Simplified (936). Thanks to a reader on <a href="http://dev.to">dev.to</a> for pointing this out.</p>
<h2>4. Everything is in one column</h2>
<p>In many European locales, Excel expects a semicolon as the CSV separator, because the comma is the decimal mark. A comma-separated file then lands entirely in column A. Use a semicolon delimiter for those users, or import with an explicit delimiter.</p>
<h2>5. Nested JSON has no single right answer</h2>
<p>CSV is flat and JSON is not. When a record contains an object, the usual answer is to flatten it into columns like <code>address.city</code>. When it contains a list, you have to choose:</p>
<ul>
<li><strong>One row per list item</strong>, repeating the parent values. Good for analysis, but row counts grow.</li>
<li><strong>The list in one cell</strong>, joined with a separator. Good for display, harder to filter.</li>
<li><strong>Numbered columns</strong> such as <code>tags.0</code>, <code>tags.1</code>. Works only if lists are short.</li>
</ul>
<p>None of these is wrong. The mistake is not choosing on purpose.</p>
<h2>6. Not every JSON file is JSON</h2>
<p>Log exports are often JSON Lines: one object per line, no outer brackets. A normal parser rejects the whole file. Read it line by line, and report the bad lines instead of stopping at the first one.</p>
<h2>The tool</h2>
<p>I put all of this into a converter that runs entirely in your browser, so your data is never uploaded: <a href="https://json2csv.online/">JSON2CSV.online</a>. It flattens nested data, keeps long IDs and leading zeros as text, reads JSONL, and writes Excel-friendly CSV or <code>.xlsx</code>.</p>
<p>If you prefer code, these guides have details and snippets:</p>
<ul>
<li><a href="https://json2csv.online/json-to-csv-python/">JSON to CSV in Python</a></li>
<li><a href="https://json2csv.online/jq-json-to-csv/">JSON to CSV with jq</a></li>
<li><a href="https://json2csv.online/json-to-csv-javascript-node/">JSON to CSV in JavaScript</a></li>
<li><a href="https://json2csv.online/excel-csv-long-numbers-leading-zeros/">Why Excel changes long numbers</a></li>
<li><a href="https://json2csv.online/csv-garbled-characters-semicolon-excel/">CSV garbled or in one column</a></li>
</ul>
<p>It is a small project and I am still finding rough edges. If you have a file it gets wrong, tell me in the comments and I will take a look.</p>
]]></content:encoded></item></channel></rss>