Excel EIN Number Format: Keep All 9 Digits Visible

How-to basics · Updated November 19, 2026

To display an EIN in Excel as 12-3456789, select the cells, press Ctrl+1, choose Custom, and enter 00-0000000 as the format. This changes how numeric values appear, not the values themselves; for dependable records—especially EINs that begin with zero—storing the identifier as text is often safer.

What an EIN Looks Like

An Employer Identification Number, or EIN, is a nine-digit identifier issued by the U.S. Internal Revenue Service for tax administration. Its conventional display pattern is two digits, a hyphen, and seven digits: XX-XXXXXXX. For example, the nine digits 123456789 are commonly written as 12-3456789.

In a spreadsheet, an EIN is an identifier, not a quantity. You do not add, average, or measure it. That distinction matters because Excel treats numeric-looking entries as numbers by default. Numbers can lose leading zeros, participate in calculations, and be displayed differently from the way they were entered. A format can make an EIN look right without changing the underlying value, but it cannot always recover digits that Excel has already discarded.

There is no need to add spaces or extra punctuation to the standard pattern. If an organization provides EINs in another form, preserve the source data and confirm the intended identifier before changing it.

Apply the EIN Custom Number Format

For numeric EIN values that are already intact, a custom number format is a quick way to add the hyphen for display. In Excel for Microsoft 365 on Windows:

  1. Select the cells containing the EINs.
  2. Press Ctrl+1 to open Format Cells.
  3. On the Number tab, select Custom.
  4. In the Type field, enter 00-0000000, then select OK.

On a Mac, select the cells and press Command+1 to open Format Cells; then choose the custom number-format category and enter the same code. The Windows and Mac keyboard shortcuts differ, but the format code is the same.

For example, a cell whose stored numeric value is 123456789 will display as 12-3456789. The hyphen is supplied by the format code; it is not inserted into the stored number. You can still see the original value in the formula bar, and copying the cell as a value may carry the number rather than the displayed punctuation.

How the Format Code Works

The code 00-0000000 contains nine zero placeholders separated by a literal hyphen. In a custom number format, zero placeholders display a digit when one is present and can show a leading zero where the displayed value has fewer digits than the number of placeholders. The hyphen tells Excel where to place the separator.

That padding can be helpful, but it is not a data-quality check. If a cell contains an eight-digit number because a leading zero was lost, the format may display a nine-digit pattern by padding the value. For instance, 87654321 can appear as 08-7654321. That appearance is only correct if the source EIN really was 087654321. A format cannot establish that the missing zero belonged there; check against an authoritative source.

Likewise, the format does not reject entries with too many digits, letters, or an incorrect sequence. A custom number format controls presentation, not validation. Review the underlying values when accuracy matters, rather than relying on the hyphenated appearance alone.

Preserve Leading Zeros by Storing EINs as Text

Text is generally the more robust choice when an EIN is a record identifier that must remain exactly as supplied. Text values retain leading zeros and are not altered by numeric display rules. You can enter an EIN with its hyphen, such as 08-7654321, or keep the nine digits without punctuation if that matches the system you exchange data with.

To enter new values as text, either set the destination cells to Text before typing or prefix an individual entry with an apostrophe. The apostrophe is an input signal and is not displayed as part of the cell value. Setting an existing numeric cell to Text does not restore a zero that has already been removed; the original source or a verified rule is needed to reconstruct it.

Text can be preferable for exports and data transfers because a number format belongs to the workbook, not to the identifier itself. If another application receives a bare numeric value, it may not retain Excel’s custom hyphen or leading-zero display. When preparing a file for another system, follow that system’s required format and check the exported result instead of assuming the workbook’s appearance will travel with it.

Format a Numeric EIN with a Formula

A helper formula can create a hyphenated text version while leaving the source column available for comparison. This is useful for a report or a separate display column, but it does not prove that the source digits are correct. Use it only when the source is known to contain the intended digits, or when any padding has been verified.

With a numeric EIN in cell A2, enter this in B2 and fill down:

=TEXT(A2,"00-0000000")

If A2 contains 87654321, the formula returns the text 08-7654321. It formats the number to the nine-character pattern and inserts the hyphen; check that the zero-padding is warranted. Because the result is text, B2 is not the original numeric value, even though it looks like an EIN. Keep the source column when you need an audit trail, and avoid using an output formula to conceal uncertain or malformed source data.

Choose Between a Custom Format and Text

Both approaches can show an EIN with a hyphen, but they serve different purposes. Choose based on how the values will be entered, checked, shared, and used later:

  • Use a custom number format when the cells contain confirmed numeric values, you want the workbook to display the hyphen, and the underlying number needs to remain numeric for some separate reason.
  • Use text when preserving the exact identifier—including a leading zero—is the priority, or when the value will be passed to another system that expects an identifier rather than a number.
  • Use a formula-generated display column when you need a separate formatted output while retaining the source data for review.

For an EIN register, customer file, or vendor list, text is usually the least surprising storage choice. A custom format is convenient for a clean on-screen display, but it can give a false sense of security if the underlying digits have not been verified. Whatever you choose, be consistent across the column; mixed numbers and text can complicate sorting, matching, and exports.

Common Problems and Checks

If the hyphen does not appear, first check whether the cell contains a number or text. A custom number format applies to numeric values; it will not insert punctuation into text such as 123456789. If the source is text, retain it as text or create a separately controlled text output rather than expecting the numeric format to change it.

If the first zero is missing, inspect the original source. Excel commonly removes leading zeros when it interprets an entry as a number. Applying the format may display a padded zero, but only the source record can confirm whether that is the correct EIN. Avoid adding zeros to every short value without checking, since a short or damaged entry may have a different cause.

Also check for spaces, apostrophes, unexpected punctuation, and mixed cell types after pasting or importing a list. One visual scan is not enough: two cells can look alike while one contains text and another contains a number. Useful checks include comparing a sample with the source records, reviewing the formula bar, and testing the output in the format required by the recipient. If the workbook will be saved as a text-based exchange file, verify the resulting file because workbook number formatting may not be preserved there.

Frequently Asked Questions

What is the correct Excel format code for an EIN?
For numeric values, use 00-0000000 in a custom number format. It displays two digits, a hyphen, and seven digits, but it does not validate the EIN or change the stored value.

Can Excel display an EIN that starts with zero?
Yes. A custom format can show a padded zero for a numeric value, and text can preserve a zero entered as part of the original identifier. Verify the source before relying on padding, because Excel cannot know whether a missing zero was genuinely part of the EIN.

Why does the EIN format not work on my cells?
The cells may contain text rather than numbers, or the entries may include extra characters. Custom number formats affect numeric values, not text strings. Check how the values are stored and whether the data contains spaces or other punctuation.

Does the custom format change the EIN itself?
No. It changes the displayed appearance only. The cell continues to hold its underlying value, so the hyphen may not be included when you copy the raw value or move data into another application.

Should I store EINs as text or numbers?
For most lists and records, text is safer because an EIN is an identifier, and text preserves leading zeros. Use numeric storage only when you have a specific reason and have confirmed that every source value is complete and correct.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.