Prepare CSV Files for SendGrid
How to prepare a CSV for a SendGrid contact import: what converting from a spreadsheet or TSV changes, common problems that break imports, and what to confirm before uploading.
Getting a contact list into SendGrid usually means turning a spreadsheet, a database export or a tab-separated file into a comma-separated file the importer can read. That conversion looks simple, but it changes the stored characters of your data. This review explains what changes, where meaning can be lost, and how to check the result before you upload it.
A note on evidence: no SendGrid-specific documentation or test results were supplied for this article. The guidance below rests on general, verifiable CSV behavior. Wherever a detail depends on SendGrid's own rules, such as exact header names, size limits or accepted encodings, it is marked as something to confirm in SendGrid's current documentation.
Is a CSV conversion the right step for your import?
For bulk contact uploads, a CSV is generally the right choice. Its main benefit is that it is a plain, widely supported format. Every row is one contact and every column is one field, so an importer can map columns to contact fields without guessing.
The main tradeoff is that CSV keeps no types or formatting. It cannot record that a postal code is text rather than a number, that a date is in month-day order, or that a cell contained a line break on purpose. Spreadsheet programs fill in those gaps by guessing, both when they open a file and when they save one. Those guesses are where most damage happens.
Plain text entry, or a very small hand-edited file, is the better choice when you are adding only a few contacts, when your data contains values a spreadsheet is likely to reinterpret, or when you cannot check the saved file in a text editor. In those cases, typing or editing the raw text directly avoids the hidden conversions a spreadsheet program applies.
What converting to CSV actually changes
CSV conversion is a stored-character change, not a visual one. Unlike styling or display effects, it rewrites the bytes in the file. The changes that matter for an import fall into four groups.
- Delimiters: the character that separates fields becomes a comma. When converting from TSV, every tab between fields is replaced, and any field that already contains a comma must be wrapped in double quotes so it stays one field.
- Quoting: fields containing commas, double quotes or line breaks are enclosed in double quotes. A double quote inside such a field is written as two double quotes in a row.
- Encoding: the text is saved in a specific character encoding. UTF-8 is the common choice for names with accented letters or non-Latin scripts. Some programs add an invisible byte-order mark at the start of the file, which some importers read as part of the first header name.
- Line endings: each row ends with a line break, written either as a carriage return plus line feed or as a line feed alone, depending on the program and operating system.
What a spreadsheet shows you is a presentation of the data, not the data itself. A spreadsheet may display a postal code as 2134 even though the source said 02134, because it parsed the value as a number. If you then save as CSV, the stored file contains 2134 and the leading zero is gone. The same applies to long numeric IDs shown in scientific notation and to dates re-ordered to match the computer's regional settings.
An illustrative file
The example below shows the structure of a well-formed file. The address placeholders stand in for real email addresses, and the header names are illustrative. SendGrid requires an email column and maps other columns to reserved or custom fields, but you should confirm the exact header spellings it expects in its current documentation. Custom fields may also need to exist in your account before an import can fill them.
email,first_name,last_name,postal_code
ADDRESS_1,Ana,"Silva, Jr.",02134
ADDRESS_2,Renée,O'Brien,10001
ADDRESS_3,Sam,"Lee ""Sammy""",94110
Checked against the rules above: the first data row quotes a last name that contains a comma. The second row has an accented letter, which needs UTF-8 to come through intact, and an apostrophe, which needs no quoting. The third row shows an embedded double quote written as two double quotes inside a quoted field. The postal code 02134 keeps its leading zero only if no program has re-saved the file as a number.
Problems that commonly break or distort an import
- Naive find-and-replace from TSV: swapping tabs for commas without adding quotes splits any field that contains a comma, which shifts the remaining columns in that row.
- Lost leading zeros and reformatted IDs: values parsed as numbers by a spreadsheet are rewritten when saved.
- Wrong encoding: saving in a legacy regional encoding instead of UTF-8 can turn accented names into garbled sequences.
- Hidden first-header damage: a byte-order mark or a stray space can make the email header fail to match, even though it looks correct on screen.
- Duplicate or blank header names: these give the importer columns it cannot map cleanly.
- Extra whitespace and invisible characters: leading or trailing spaces, non-breaking spaces and zero-width characters inside an email address can make an otherwise valid address fail validation.
- Wrong delimiter: some regional spreadsheet settings save semicolon-separated files under a CSV name, and an importer expecting commas may read them as a single column.
Will the file stay usable after copying or sharing?
Copying cells out of a spreadsheet and pasting them into a text editor usually produces tab-separated text, not comma-separated text. Pasting that into a file named with a CSV extension does not make it a CSV. If you build the file by copying and pasting, open the result in a plain text editor and confirm that the delimiters are commas and that quoting is present where needed.
Text copied from word processors, chat apps or web pages can carry curly quotation marks, non-breaking spaces and zero-width characters. These look normal but are different stored characters. Inside a quoted field they can break the quoting. Inside an email address they make the address invalid. Pasting through a plain text editor, or using a tool that shows invisible characters, is a reasonable check.
Sharing the file by email or a file-sharing service generally leaves its bytes unchanged. Opening it in a spreadsheet and saving it again does not, and the person you share it with may do exactly that. If a colleague needs to review the list, ask them not to re-save it, or re-check the file after they return it.
Accessibility matters here mainly because CSV values can flow into emails through personalization. If a name or other field uses decorative Unicode lookalike letters, the import stores those substituted characters as they are. Personalized emails would then show them, they may not render in every email client, and screen readers can announce them inconsistently or not as ordinary words. No scoped test of specific email clients or assistive technologies was supplied, so the safe recommendation is to keep field values in ordinary plain letters and leave visual styling to the email template.
What the supplied evidence does not confirm
- The exact reserved header names SendGrid recognizes and whether matching is case-sensitive.
- File size or row-count limits for a single upload.
- Whether SendGrid accepts encodings other than UTF-8, and how it treats a byte-order mark.
- Whether delimiters other than commas are accepted.
- How duplicates, blank email cells and invalid addresses are handled during import.
- How SendGrid stores, retains or deletes uploaded files; this cannot be inferred from how the interface looks or how it is described in marketing.
Check each of these against SendGrid's current documentation before relying on them, especially for large or sensitive lists.
A practical pre-upload check
- Keep an untouched copy of the original export.
- If you use a spreadsheet, set columns such as postal codes, phone numbers and IDs to text before entering or importing data.
- Save as comma-separated values in UTF-8.
- Open the saved file in a plain text editor and confirm the header row, the comma delimiters, the quoting around fields with commas or quotes, and that leading zeros are intact.
- Confirm that the email header matches the name SendGrid expects, with no stray spaces before it.
- Search for curly quotes, non-breaking spaces and other invisible characters, especially in the email column.
- Test with a small file of a few rows, check how the fields map in SendGrid, then upload the full list.
Bottom line: a CSV conversion keeps your contact data meaningful and usable for SendGrid when you control the encoding, delimiters and quoting, and when you check the saved text rather than its spreadsheet display. When you cannot run that check, or the list is only a handful of contacts, editing or entering plain text directly is the more reliable route.