How to standardise country codes in a csv
- Step 1Audit the country values first — Open the CSV and note every spelling in the country column —
UK,GB,Great Britain,United Kingdom,England,Scotland,Wales. Each distinct spelling is one Find/Replace pass (or one regex alternation). - Step 2Drop the CSV onto the tool — The dropzone accepts
.csv,.tsv, and.txt. PapaParse auto-detects whether your file is comma-, tab-, or semicolon-delimited, so an EU-locale semicolon export works without conversion. - Step 3Enter one variant and its ISO code — Find
United Kingdom, Replace withGB. Leave Case sensitive off sounited kingdomandUNITED KINGDOMare caught too. The matched substring is replaced everywhere it appears in a data cell. - Step 4Run and read the replacements counter — Click Replace. The result panel shows Replacements made (the count of cells changed, not occurrences) and Data rows. A surprisingly low count usually means a spelling you missed; a surprisingly high one means the string matched outside the country column — see the edge cases.
- Step 5Chain the next variant by re-feeding the output — Download the
.replaced.csv, drop it back in, and run the next variant (Great Britain→GB, thenEngland→GB). Or do them all in one pass with Regex mode and an alternation pattern. - Step 6Download and load into your API or report — Click Download CSV (file is saved as
<name>.replaced.csv) and import into your logistics API, geo-report, or warehouse. The output is plain UTF-8 CSV with quotes only where required.
Country-variant to ISO 3166-1 alpha-2 mapping
Common spellings seen in CRM, ecommerce, and order CSVs, and the ISO code to standardise on. Each row is one Find/Replace pass — or fold them into one Regex-mode alternation.
| Find (variant) | Replace with (ISO) | Case sensitive? | Notes |
|---|---|---|---|
| United Kingdom | GB | Off | Also map Great Britain, England, Scotland, Wales, U.K., UK to GB |
| United States | US | Off | Also map USA, U.S.A., America, U.S. |
| Deutschland | DE | Off | Native-language names appear in German-locale exports |
| Republic of Ireland | IE | Off | Distinguish from Northern Ireland (part of GB) |
| United Arab Emirates | AE | Off | Often abbreviated UAE in spreadsheets |
| South Korea | KR | Off | Also Korea, Republic of and Republic of Korea |
Options on this tool — what is and is not here
The full option surface for CSV Find & Replace. There is no column selector, no multi-pair grid, and no preset list — those would have to be done one pass at a time or with regex.
| Control | What it does | Default | Relevant to country codes |
|---|---|---|---|
| Find | The text or pattern to search for in every data cell | (empty) | The country variant, e.g. United Kingdom |
| Replace with | The text to substitute; leave empty to delete the matched text | (empty) | The ISO code, e.g. GB |
| Case sensitive | When off, uk / UK / Uk all match; when on, only the exact casing matches | Off | Leave off so all casings of a spelling collapse |
| Regex mode | Treats Find as a JavaScript regular expression instead of literal text | Off | Use ^...$ anchors to match a whole cell value, or | to map several spellings at once |
Cookbook
Before/after rows from real customer and order CSVs. The tool replaces matched substrings in every data cell and leaves the header row alone.
Map the five UK spellings to GB in one regex pass
ExampleRather than five literal passes, tick Regex mode and use a whole-cell alternation. The ^ and $ anchors mean it only fires when the entire cell equals one of the listed spellings — so a England inside a town name like New England is safe.
Input (Country column has five spellings): Customer,Country Acme Ltd,United Kingdom Beta GmbH,Great Britain Gamma Co,England Delta Inc,UK Epsilon,U.K. Find (Regex mode ON): ^(United Kingdom|Great Britain|England|UK|U\.K\.)$ Replace with: GB Output: Customer,Country Acme Ltd,GB Beta GmbH,GB Gamma Co,GB Delta Inc,GB Epsilon,GB Replacements made: 5 (one per cell changed)
Two-letter alpha-2 already present — no double conversion
ExampleIf half the column already has GB and you run United Kingdom→GB, the cells that already say GB are not matched by the Find string, so they are left exactly as-is. The counter only increments for cells that actually changed.
Input: Name,Country Row1,GB Row2,United Kingdom Find: United Kingdom Replace with: GB Output: Name,Country Row1,GB Row2,GB Replacements made: 1
Header named 'United Kingdom' is protected
ExamplePivot-style exports sometimes use country names as column headers. Because Find & Replace skips row 0 entirely, a header reading United Kingdom is preserved while the data cells beneath the matching value are converted.
Input (country names as headers — a per-region sales pivot): United Kingdom,Germany,Region 120,90,United Kingdom 80,60,Germany Find: United Kingdom Replace with: GB Output (header row 0 untouched, data cell converted): United Kingdom,Germany,Region 120,90,GB 80,60,Germany Replacements made: 1
Case-insensitive default catches mixed casing
ExampleHand-keyed data has usa, USA, and Usa. With Case sensitive OFF, a single Find USA matches all three. The replacement text you type is what gets written, so the output is uniformly US.
Input: Order,Ship-To 1001,usa 1002,USA 1003,Usa Find: USA Replace with: US (Case sensitive OFF) Output: Order,Ship-To 1001,US 1002,US 1003,US Replacements made: 3
Strip dots from abbreviated codes before standardising
ExampleSome exports write U.K. and U.S.. Strip the dots first with a literal pass, then convert. Two passes: feed the first output back in for the second.
Pass 1 — Find: U.K. Replace with: UK (Regex OFF, so dots are literal) Pass 1 — Find: U.S. Replace with: US (re-feed output) Pass 2 — Find: UK Replace with: GB Pass 2 — Find: US Replace with: US (no-op, already correct) Before: U.K. / U.S. After pass 1: UK / US After pass 2: GB / US
Errors and edge cases
Real errors and silent failures sourced from each platform's own documentation. Match the wording to the row, fix what the row says to fix.
No column selector — `England` matches inside town names
By designFind & Replace operates on every data cell in the file, not a column you choose. A literal Find England will also match the England inside New England Patriots Supplies in a Company column. Fix: use Regex mode with whole-cell anchors ^England$ so it only fires when the entire cell equals England, or run the value through csv-column-filter first if you need to isolate rows by column.
Header row is never replaced
PreservedRow 0 is always returned unchanged — if (ri === 0) return row. This is usually what you want (a Country heading stays Country), but if your file has no header row, the first data row is treated as a header and will be skipped. Fix: add a throwaway header row before processing, or use csv-header-rename conventions; the tool assumes the first row is headers.
Already-correct `GB` cells are left alone
ExpectedA Find string only changes cells that contain it. Running United Kingdom→GB does nothing to cells that already read GB, so re-running the same pass is safe and idempotent. The replacements counter reflects only cells that actually changed.
Invalid regex silently makes no changes
No changesIf Regex mode is on and your pattern has a syntax error (e.g. an unclosed group ^(United), the tool catches the error and returns the file unchanged with 0 replacements rather than crashing. Fix: if your replacements counter is 0 and you expected matches, re-check the regex — a stray (, [, or \ is the usual culprit.
Partial-match overreach — `US` inside `AUSTRALIA`
By designA literal Find US (Regex off) matches the US substring inside AUSTRIA, AUSTRALIA, or even an email like bus@x.com. Without anchors the match is substring-based and global within each cell. Fix: use Regex mode with ^US$ (whole cell) or \bUS\b (word boundary) to avoid clobbering other values.
Free tier caps at 2 MB / 500 rows
Tier limitFree accounts can process files up to 2 MB and 500 data rows. A 40,000-row customer export will be blocked on free. Fix: upgrade to Pro to remove the row and file limits, or split the file first with csv-row-splitter, standardise each chunk, then recombine with csv-merger.
One pass = one variant; you cannot paste a mapping table
By designThere is no grid for UK→GB, US→US, DE→DE entered at once. Each distinct spelling is its own pass (re-feed the output), or you fold same-target spellings into one Regex alternation. For a large many-to-many lookup, a script or spreadsheet VLOOKUP is a better fit than repeated passes.
Semicolon-delimited EU export converts cleanly
SupportedGerman/French Excel writes CSVs with ; delimiters. PapaParse auto-detects the delimiter on input, and the output is re-serialised — so a semicolon file is parsed and written back correctly. The delimiter on output follows PapaParse's unparse default (comma); if you need to keep semicolons, re-export from your destination tool or post-process.
Frequently asked questions
Can I map all five UK spellings to GB in one go?
Yes, but only via Regex mode — there is no multi-pair grid. Tick Regex mode and use an alternation with whole-cell anchors: Find ^(United Kingdom|Great Britain|England|UK|U\.K\.)$, Replace with GB. For literal (non-regex) matching you run one pass per spelling, feeding each output back into the tool.
Does the tool let me pick the country column?
No. There is no column selector — replacement runs across every data cell in the file. To avoid hitting the same string in another column, use Regex mode with whole-cell anchors (^England$) so only cells equal to the value are changed, or pre-filter rows with csv-column-filter.
Is matching case-sensitive?
Case-insensitive by default, so uk, UK, and Uk all match a single Find UK. Tick Case sensitive if you need exact-case matching — useful when, say, you want to convert lowercase gb but leave an existing uppercase GB placeholder alone.
Will this change country codes that are already correct?
No. Only cells containing your Find string are altered. If a cell already reads GB, running United Kingdom→GB leaves it untouched, and the replacements counter does not increment for it. The operation is idempotent for already-correct values.
What happens to my header row?
It is never modified. The tool always returns row 0 unchanged, so a Country or Ship-To Country heading survives every pass. The flip side: if your file has no header row, the first data row is treated as a header and skipped — add a placeholder header first.
How do I map several variants to the same code without regex?
Run consecutive literal passes and re-feed the output each time: pass 1 United Kingdom→GB, download, drop the result back in, pass 2 Great Britain→GB, and so on. Each pass is non-destructive to already-converted cells, so order doesn't matter.
Can I strip a substring like the dots in `U.K.`?
Yes. With Regex mode OFF the Find text is treated literally, so Find U.K. Replace with UK removes the dots. (Note: in Regex mode . means any character, so use literal mode or escape the dots as \. to match a literal full stop.)
What does the 'Replacements made' number count?
It counts cells that changed, not the number of occurrences. If one cell contained the Find string twice, that's still one cell — but both occurrences in it are replaced (replacement is global within each cell). Use it as a sanity check: a count far below the rows you expected means a missed spelling.
What file types and sizes are supported?
.csv, .tsv, and .txt are accepted, with auto delimiter detection. Free tier caps at 2 MB and 500 data rows; Pro removes both limits. For larger customer exports, split with csv-row-splitter and recombine with csv-merger.
Is my customer data uploaded anywhere?
No. PapaParse runs entirely in your browser — addresses, order data, and country values never reach a JAD server. The only thing stored server-side is a single anonymous run counter for signed-in dashboard stats, which you can opt out of in account settings.
I need to validate the codes too, not just standardise them — what now?
Find & Replace doesn't validate against the ISO list — it just substitutes text. After standardising, run csv-validator to spot stray values, or csv-duplicate-finder to confirm you didn't accidentally merge two distinct codes. For broad cleanup (whitespace, casing) before this step, csv-cleaner is the companion.
Can I automate this for a recurring export?
Yes. GET /api/v1/tools/csv-find-replace returns the option schema (find, replace, caseSensitive, useRegex); pair the @jadapps/runner once and POST the payload to 127.0.0.1:9789/v1/tools/csv-find-replace/run. Because there's one pair per call, a country-standardisation pipeline chains several runner calls — one per regex pattern — on a scheduled export.
Privacy first
Processing runs locally in your browser with PapaParse. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.