Using MaxMind CSV Files: Structure, Conversion and Practical Limits
How MaxMind's CSV geolocation files are organized, what CSV-to-TSV, range and join conversions change, and when the original files or the binary format serve better.
MaxMind distributes its GeoIP2 and GeoLite2 geolocation data in a binary database format and also as CSV files. The CSV edition is aimed at people who want to load the data into a relational database, a data warehouse, a spreadsheet or a custom pipeline. This review looks at what happens when you open, convert or reshape those files, and whether the result keeps the meaning and usability you need. Conversions covered include switching to tab-separated values, rewriting network blocks as address ranges, and joining tables.
No test results, measurements or release-specific details were supplied for this review. The statements below describe documented general behavior of delimited text and the publicly described layout of MaxMind's CSV databases. Points that depend on a particular edition, release or license are flagged for you to verify.
Is a CSV workflow the right fit?
The CSV files work well for bulk import, analytical joins, building your own lookup tables, and inspecting the data directly. Their main benefit is transparency. Any tool that reads delimited text can open them, and you can see exactly which networks map to which locations.
The main tradeoff is that CSV is not a lookup format. The block files list networks in CIDR notation, so finding the record for a single IP address requires range-aware logic or an index that you build yourself. If your goal is per-request lookups inside an application, MaxMind's binary database with its official reader libraries is usually the simpler and less error-prone choice. CSV makes sense when you need the data inside your own database, want to join it with other tables, or need to audit or analyze it in bulk.
Keep the original, unmodified CSV files whenever you convert them. The originals are the reference for re-importing, for comparing one release with the next, and for checking whether a conversion introduced errors. Converted copies should be treated as derived artifacts that you can regenerate.
What a conversion actually changes
In this context, a transformation means a change to the stored data itself: the delimiter, the quoting, the character encoding, the column layout or the way an address block is represented. It does not mean visual effects such as reversed or mirrored text or decorative Unicode styling, which have no role in this workflow.
It helps to separate stored changes from presentation. A spreadsheet may display a value differently from how it is stored, for example by hiding leading zeros or rounding a coordinate. That display change becomes a stored change once the file is saved back out.
How the files are organized
A MaxMind CSV database is typically delivered as a compressed archive containing two kinds of files:
- Block files, with IPv4 and IPv6 in separate files. Each row describes one network in CIDR notation, alongside identifiers and attributes.
- Location files, with one file per language. Each file holds place names keyed by a geoname_id.
Block rows refer to locations through geoname_id values, so most practical uses involve joining the two kinds of file. The exact columns differ between products such as country, city and ASN data, and can change between releases. Read the header row rather than relying on fixed column positions.
The following excerpt is illustrative only. It shows an abbreviated header and one row of placeholder values. The address uses a range reserved for documentation, and the identifier is invented. It is not real MaxMind data.
network,geoname_id,registered_country_geoname_id,represented_country_geoname_id,is_anonymous_proxy,is_satellite_provider
192.0.2.0/24,1234567,1234567,,0,0
Empty fields are meaningful. A blank represented_country_geoname_id is not the same as a zero, and a conversion that fills blanks with a default value changes the meaning of the data.
Common conversions and their risks
| Conversion | What changes in the stored data | Main risk |
| CSV to TSV | Delimiter changes from comma to tab; quoting around fields may be dropped | Fields containing tabs or line breaks break the layout; tools that expect quoted fields may misread values |
| CIDR network to start and end addresses or integers | The representation of each network changes, not the set of addresses covered | IPv6 values exceed 64-bit integer range; off-by-one errors at range boundaries; IPv4 and IPv6 must stay distinguishable |
| Joining blocks with locations | Location names and codes are copied onto each block row | Large growth in file size; an inner join silently drops rows whose geoname_id is empty |
| Opening and saving in a spreadsheet | Values may be reinterpreted as numbers, dates or other types | Leading zeros lost in postal codes, coordinate precision reduced, encoding changed, rows cut off at application limits |
| Re-encoding from UTF-8 | Byte encoding of text changes | Accented and non-Latin place names become garbled or are replaced |
| Switching location language file | The language of place names changes | Some names may be missing in a given language; confirm how empty names are handled |
MaxMind has published an open-source converter that rewrites the network column of its CSV files into range-based forms. Check its current documentation for supported output options before relying on it. If you write your own conversion, use a proper IP address library rather than string manipulation, especially for IPv6.
To check that a conversion preserved the data, use these steps:
- Confirm that row counts match between the original and converted files, allowing for the header row.
- Confirm that the header names survived unchanged.
- Verify the downloaded archive against a checksum, if one is provided with the download.
- Spot-check a handful of addresses against a lookup from the binary database of the same release.
Will the result stay usable after copying or sharing?
Copying and pasting delimited text depends on the destination. Many spreadsheet applications use tab-separated text on the clipboard, so TSV often pastes into a grid more predictably than CSV. CSV pasted into a cell grid may land in a single column until you run a text-to-columns or import step. This behavior varies by application and settings. Test the specific tool you plan to use rather than assuming one successful paste generalizes.
Encoding is the most common source of silent damage. If a tool opens the files with an encoding other than UTF-8, place names with diacritics or non-Latin scripts can be corrupted. Saving the file then makes the corruption permanent. When importing, set the encoding explicitly instead of relying on automatic detection.
The CIDR representation also limits search and editing. A plain text search for an individual IP address will usually not find the network that contains it, because the file lists blocks rather than individual addresses. Finding the matching row requires range logic, a database query or a lookup library. Manual edits to a network value can also change which addresses a row covers, so treat these files as read-only reference data.
Accessibility matters when you share excerpts. Raw CSV read by a screen reader is a stream of values and commas without column context. When you include sample rows in a report or web page, present them as a real table with header cells. If the point is a conclusion rather than the data itself, add a sentence summarizing it. No specific assistive technology was tested for this review.
Before sharing converted files outside your organization, review the license terms for the specific MaxMind product you downloaded. Free and commercial editions carry their own conditions, which may cover redistribution and attribution. Those terms are not summarized here because they were not part of the supplied material.
Also present the data accurately. IP geolocation is approximate and should not be described as the precise location of a person or device. Where the files include accuracy-related fields, carry them through any conversion so downstream users can see how much confidence each record deserves.
Open questions to verify
- The exact column list for your edition and release, taken from the header row.
- Whether a checksum is provided with your download and how to verify it.
- The license terms covering storage, redistribution and attribution for your product.
- The row limits and default import behavior of any spreadsheet or database tool you use.
- The current options of MaxMind's CSV converter, if you plan to use it.