<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ankur Soni</title>
    <description>The latest articles on DEV Community by Ankur Soni (@ankursonidev).</description>
    <link>https://dev.to/ankursonidev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3982219%2Fb84b77ba-d89a-415c-b7eb-f91987944ca1.jpg</url>
      <title>DEV Community: Ankur Soni</title>
      <link>https://dev.to/ankursonidev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ankursonidev"/>
    <language>en</language>
    <item>
      <title>Your JSON-to-Excel Converter Is Probably Corrupting Your Data. Here's the 30-Second Test</title>
      <dc:creator>Ankur Soni</dc:creator>
      <pubDate>Sat, 13 Jun 2026 07:01:28 +0000</pubDate>
      <link>https://dev.to/ankursonidev/your-json-to-excel-converter-is-probably-corrupting-your-data-heres-the-30-second-test-3e6m</link>
      <guid>https://dev.to/ankursonidev/your-json-to-excel-converter-is-probably-corrupting-your-data-heres-the-30-second-test-3e6m</guid>
      <description>&lt;p&gt;&lt;strong&gt;Last week a JSON-to-Excel tool quietly changed my data and I almost shipped it to a client.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I pasted an API response into the top "JSON to Excel" tool on Google, downloaded the file, and opened it - an order ID ending in &lt;code&gt;...3456&lt;/code&gt; now ended in &lt;code&gt;...3400&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;No error. No warning. The spreadsheet looked perfect. The data was just wrong.&lt;/p&gt;

&lt;p&gt;That's the worst kind of bug - the silent one. You trust it, you ship it, and you find out weeks later when the numbers don't reconcile.&lt;/p&gt;

&lt;p&gt;Then I found out &lt;em&gt;why&lt;/em&gt;. It's not really the tool's fault. It's JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 10-second demo that should scare you
&lt;/h2&gt;

&lt;p&gt;Open your console:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;{"id": 1099511627776123456}&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="c1"&gt;// → 1099511627776123400   ❌ last digits gone&lt;/span&gt;

&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;{"id": 9007199254740993}&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="c1"&gt;// → 9007199254740992      ❌ off by one&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JS numbers are IEEE-754 doubles. The largest integer they hold exactly is &lt;code&gt;Number.MAX_SAFE_INTEGER&lt;/code&gt; = &lt;code&gt;9007199254740991&lt;/code&gt; (2⁵³−1). Anything bigger - 64-bit DB IDs, Discord/Twitter snowflakes, GST invoice numbers - gets rounded by &lt;code&gt;JSON.parse&lt;/code&gt; &lt;strong&gt;before your converter even runs.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The kicker: even if a tool parses it right, Excel &lt;em&gt;also&lt;/em&gt; stores numbers as float64 - so it has to write the value as a &lt;strong&gt;text cell&lt;/strong&gt; or the rounding comes right back. Most tools don't.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three more traps
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Leading zeros&lt;/strong&gt; → &lt;code&gt;Number("007890")&lt;/code&gt; is &lt;code&gt;7890&lt;/code&gt;. Account numbers and PINs die instantly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Formula injection&lt;/strong&gt; → a cell value of &lt;code&gt;=1+1&lt;/code&gt; (or &lt;code&gt;=HYPERLINK(...)&lt;/code&gt;) can &lt;em&gt;execute&lt;/em&gt; when Excel opens the file. If that JSON came from user input, it's a security hole. Safe tools write it as text.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dates&lt;/strong&gt; → some tools silently timezone-shift &lt;code&gt;2026-03-31&lt;/code&gt; into a different value. You won't catch it unless you look hard.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 30-second test (save this)
&lt;/h2&gt;

&lt;p&gt;Paste this into any converter, open the result, check three things:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1099511627776123456&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"acct"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"007890"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;99.5&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Did the ID keep &lt;strong&gt;all 19 digits&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;Did &lt;code&gt;007890&lt;/code&gt; keep its &lt;strong&gt;leading zero&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;Is &lt;code&gt;99.5&lt;/code&gt; still a &lt;strong&gt;number you can SUM&lt;/strong&gt; (not text)?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Fail any one, and you've been shipping subtly wrong spreadsheets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Doing it right
&lt;/h2&gt;

&lt;p&gt;A correct converter threads a needle: preserve unsafe values (big IDs, leading zeros) as &lt;strong&gt;text&lt;/strong&gt;, but keep clean numbers &lt;strong&gt;numeric&lt;/strong&gt; so you can still do math - guard formula cells, leave dates alone unless asked.&lt;/p&gt;

&lt;p&gt;I got tired of tools that didn't, so I built one that does - client-side, so your JSON never leaves the browser (it's data; it shouldn't): &lt;strong&gt;&lt;a href="https://www.jsontoexcel.in" rel="noopener noreferrer"&gt;jsontoexcel.in&lt;/a&gt;&lt;/strong&gt;. Free, no signup, passes the test above, handles nested JSON, and even parses Indian GST returns (GSTR-2A/2B/1) that most tools choke on.&lt;/p&gt;

&lt;p&gt;But seriously - &lt;strong&gt;whatever tool you use, run the test first.&lt;/strong&gt; 30 seconds now beats a corrupted report later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's the worst silent data corruption that's bitten you?&lt;/strong&gt; Drop it below 👇 - I'm collecting edge cases.&lt;/p&gt;

</description>
      <category>json</category>
      <category>javascript</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
