SSN Formatter
EverydayFormat 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
- 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.
- Select the output format from the dropdown — standard dashes (XXX-XX-XXXX), spaces (XXX XX XXXX), or plain digits (XXXXXXXXX).
- Toggle "Mask middle group" if you want the two-digit group number replaced with
**in the output. - 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.
- Click the copy button to copy all formatted SSNs to your clipboard, ready to paste into a spreadsheet, database tool, or document.
- 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, replacedigits[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