3 ms·
Ask HN: Why are csv files so much larger than xml files?
I have an XML file that I regularly convert to CSV as additional data gets added. Something that I find curious is that the XML file is roughly one half the size of the CSV, even though the XML has many, many more characters due to the tags. What gives? Could it have to do with the type of encoding?
- jgrahamc 15y agoCan you post an example?
- tomrod 15y agoExample is coming from Prosper.com data. In addition to the XML, an XML to CSV jar converter is provided. The size after conversion is 3x that of the original XML--which just seems odd to me.
- SchizoDuckie 15y agoThe only thing i can think of is that your csv is probably automatically converted to utf8, or utf16, whereas your xml is an iso-8859-1 ? There is no other reason thinkable. CSV is one of the most (byte)efficient formats out there, even in comparison to json or compressed xml