HomeFormattersEverydaySSN Formatter

SSN Formatter

Everyday

Format raw Social Security Numbers into XXX-XX-XXXX instantly. Accepts bulk input, strips non-digits, and optionally masks digits — all in your browser.

What is a SSN?

The SSN Formatter takes raw Social Security Number input — any mix of digits, hyphens, spaces, or other separators — and outputs each number in a clean, consistent display format. The standard format defined by the US Social Security Administration is XXX-XX-XXXX: three-digit area number, two-digit group number, four-digit serial number, separated by hyphens.

Consistent SSN formatting matters in developer and administrative workflows where SSNs arrive from multiple sources in inconsistent forms. A form submission might store 123456789, a scanned document might show 123 45 6789, and a legacy database export might have 123.45.6789 — all representing the same number. The formatter normalises all of these to 123-45-6789 (or your chosen format) in a single pass.

This formatter is distinct from the SSN Validator, which checks whether the number's structure is legitimately issuable by the SSA (valid area numbers, non-zero group and serial components). The formatter simply applies a display pattern to whatever digits are provided — validation is a separate step.

All formatting happens client-side in your browser. No input is transmitted to any server, stored, or logged. This is essential when handling US government identification numbers, which carry significant privacy and regulatory implications under federal law.

How to use this SSN calculator

  1. Paste your SSN input into the "Raw SSN Input" textarea — one SSN per line. Input can be raw digits, hyphen-formatted, space-formatted, or a mix.
  2. Select the output format from the dropdown — standard dashes (XXX-XX-XXXX), spaces (XXX XX XXXX), or plain digits (XXXXXXXXX).
  3. Toggle "Mask middle group" if you want the two-digit group number replaced with ** in the output.
  4. Review the output in the "Formatted SSN(s)" panel — lines that cannot be formatted (wrong digit count) display an error message specifying the input and the actual digit count found.
  5. Click the copy button to copy all formatted SSNs to your clipboard, ready to paste into a spreadsheet, database tool, or document.
  6. Fix any flagged errors — identify the lines with digit-count mismatches in your source data, correct them, and re-paste for a clean output.

Formula & Methodology

Formatting algorithm:

1. Split input by newlines to process each SSN independently.
2. Strip all non-digit characters from the line using /\D/g.
3. Check digit count — if not exactly 9, output an error for that line.
4. Split the 9-digit string into three groups: digits[0..2] (area), digits[3..4] (group), digits[5..8] (serial).
5. If masking is enabled, replace digits[3..4] with **.
6. Join the groups with the chosen separator (hyphen, space, or nothing).

Before/after example:

| Raw Input | Output (dashes) | Output (masked) |
|---|---|---|
| 123456789 | 123-45-6789 | 123-**-6789 |
| 987 65 4321 | 987-65-4321 | 987-**-4321 |
| 555.44.3333 | 555-44-3333 | 555-**-3333 |
| 12345 | Error: expected 9 digits, got 5 | — |
| 123-45-6789 | 123-45-6789 | 123-**-6789 |

What the formatter does NOT do:
- It does not validate whether an SSN is legitimately issued (valid area/group/serial combinations). Use the SSN Validator for that.
- It does not detect duplicate SSNs across multiple lines.
- It does not encrypt or hash the SSN — if your use case requires secure storage, apply hashing after formatting using a server-side process.

For background on the underlying term, see our glossary entry on SSN.

Frequently Asked Questions

An SSN Formatter is a tool that takes raw Social Security Number input — digits with or without separators — and outputs them in a consistent, standardised format. The standard US format is XXX-XX-XXXX, where the first three digits are the area number, the next two are the group number, and the last four are the serial number. Consistent formatting is important for database storage, form submissions, printed documents, and display in user interfaces.
The Social Security Administration (SSA) uses the format XXX-XX-XXXX as the standard display format — three digits, a hyphen, two digits, a hyphen, and four digits. For example, a raw input of 123456789 becomes 123-45-6789. Some systems also accept space-separated (123 45 6789) or unformatted (123456789) forms. The SSN Formatter supports all three output styles.
An SSN Formatter applies a display pattern (XXX-XX-XXXX) to raw digit input — it reformats whatever digits are provided without checking whether the SSN is legitimately issued. An SSN Validator checks whether the number follows SSA issuance rules: the area number cannot be 000, 666, or 900–999; the group number cannot be 00; the serial number cannot be 0000. For validation, use the [SSN Validator](/ssn-validator/) after formatting.
Yes — paste one SSN per line in the input area and all will be formatted simultaneously. The formatter processes each line independently, stripping any non-digit characters (hyphens, spaces, dots) and applying the chosen output format. Lines that do not produce exactly 9 digits are flagged with an error message so you can identify and correct them.
The 'Mask middle group' option replaces the two-digit group number with asterisks in the output: 123-45-6789 becomes 123-**-6789. This is useful when displaying SSNs in reports, screenshots, or UI mockups where the full number should not be visible — for example, when a customer service agent needs to confirm an SSN without the screen showing the full number.
No — all formatting happens entirely in your browser using JavaScript. Your SSN input never leaves your device and is never sent to any server. There are no cookies, no session storage, and no logging of input. The page works offline once loaded. This is an important trust guarantee for handling sensitive US government identification numbers.
The formatter accepts raw digits regardless of how they are currently separated — 123.45.6789, 123 45 6789, 123-45-6789, or 123456789 all produce the same cleaned output. It strips everything that is not a digit and then applies the chosen format. If the resulting digit count is not exactly 9, it flags that specific line as an error. It cannot repair an SSN that has an incorrect digit count.
Paste one or more SSNs into the input area, one per line. Select your preferred output format — standard dashes (XXX-XX-XXXX), spaces (XXX XX XXXX), or plain digits (XXXXXXXXX). Toggle 'Mask middle group' if you want asterisks in place of the two-digit group. The formatted results appear instantly in the output panel. Click the copy button to copy all formatted SSNs to your clipboard.
The formatter strips all non-digit characters before processing. A line like 'SSN: 123-45-6789' becomes '123456789', which then formats correctly. Only the resulting digit count matters — if stripping non-digits leaves anything other than exactly 9 digits, that line is reported as an error. Common causes of errors include partial SSNs, extra digits, or placeholder text mixed into the input.
Using a fully client-side formatter (one that processes data only in your browser) is safe from a data-transmission standpoint — your input is never sent to a remote server. Before pasting real SSNs into any web tool, confirm that the tool clearly states it is client-side only and does not log inputs. This SSN Formatter processes all data locally and does not transmit or store any information.
A Social Security Number (SSN) is a 9-digit identifier issued by the US Social Security Administration to US citizens, permanent residents, and temporary working residents. It is used for income reporting to the IRS, credit checks, employment eligibility verification (Form I-9), government benefits, and as the primary identifier in many banking and financial systems. Indian citizens working in the US on H-1B, L-1, or other work visas are typically issued an SSN by the SSA.
Also known as
format SSNsocial security number formatterSSN XXX-XX-XXXXformat social security numberSSN mask formatter