Estimate CSV file size and compare it with JSON for the same data.
CSV stores column names once in the header rather than repeating them per record, which makes it far smaller than JSON for tabular data. The saving grows with row count. For bulk data export the format choice can change file size several-fold, which matters for both transfer time and storage cost.
CSV Size
Size = rows × columns × (value length + delimiter) + header row
Size = rows × columns × (value length + delimiter) + header row CSV stores column names once in the header rather than repeating them per record, which makes it far smaller than JSON for tabular data. The saving grows with row count.
For bulk data export the format choice can change file size several-fold, which matters for both transfer time and storage cost.
This calculator takes 5 inputs: Number of rows, Number of columns, Average value length, Average header name length, Gzip compression saving. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.