

Ask HN: Why are csv files so much larger than xml files? - tomrod

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?
======
SchizoDuckie
The 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

------
jgrahamc
Can you post an example?

~~~
tomrod
Example 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.

~~~
jgrahamc
I'd be happy to take a look if you could send me an example of an XML file and
its conversion to CSV.

