Remove Underscores
Remove underscores from text with our free online underscore remover. Replace underscores with spaces in copied labels, names, and lists, then review and copy your text.
How to remove underscores from text online
An underscore, also called an underbar, is the character _. It often separates words in exported labels and filenames. Follow these steps to replace it with a space in your pasted text.
Paste your text
Type or paste into the editor. The Paste button is available when the box is empty; your usual keyboard shortcut or phone's paste menu also works. Keep the original somewhere if you may need it later.
Replace underscores with spaces
Select Remove underscores to turn them into spaces throughout the box. There are no settings to configure. Ctrl+Enter or Command+Enter runs the same action while the editor is focused. Each consecutive group of underscores becomes one space.
Review and copy the result
Your result appears in the same editable box. Read it, make any final changes, and select Copy. Clear empties the editor for the next task. The clipboard and Clear controls sit beneath the text, beside the removal action on larger screens.
Examples of replacing underscores with spaces
These before-and-after examples show how the tool replaces underscores in headings, names, exported labels, and text with repeated underscores.
Headings and lists
Replace underscores with spaces in headings, labels, and copied lists to separate the words.
Names and numbers
Keep letters and numbers in their original order while separating the parts of a copied label.
Exported labels
Turn an exported field name into a phrase that is easier to read in a document or message.
Repeated underscores
A consecutive group of underscores becomes one space, without changing the surrounding words.
Adjacent underscores are grouped, so one___two becomes one two. Spaces already around those underscores are preserved. The tool does not trim spaces at the beginning or end, or remove extra spaces elsewhere. Review the result and make any small spacing adjustments directly in the editor.
Remove underscores from copied names and labels
Use this tool to replace underscores in copied product names, turn exported column headings into readable labels, or prepare a list for a document. Paste several lines at once: the replacement applies across the whole passage while keeping line breaks and tabs.
For example, customer_first_name becomes customer first name, and AB_204 becomes AB 204. Check whether the separator carries meaning before changing an identifier, email address, or URL. Keep an unchanged copy when the original spelling matters to another system.
Pasting a filename only changes the text in this editor. It does not rename a file on your device. Likewise, editing a URL's text does not update its destination. Use the result only where the new spelling is appropriate, such as a readable label rather than a working link.
How to remove underscores in Python and Excel
The editor handles pasted text. For recurring cleanup inside your own script or spreadsheet, these examples show the equivalent basic replacements. Run them in Python or Excel, not in the editor above.
Remove underscores from a string in Python
Use str.replace() when you want to remove underscores in Python. An empty replacement deletes every matching character; a space separates the parts instead.
text = "first_last"
cleaned = text.replace("_", "")
# firstlast
spaced = text.replace("_", " ")
# first lastAssign the returned string to a variable: the original string is unchanged. Unlike this tool, Python's simple replacement inserts one space per underscore, including repeated ones. Apply it to string values, not indiscriminately to an entire code file where underscores may be part of variable names.
Python’s string replacement referenceHow to remove underscores in Excel
To remove underscores in Excel, enter a SUBSTITUTE formula in a spare column. If A1 contains first_last, these formulas give the corresponding results.
=SUBSTITUTE(A1,"_","")
→ firstlast
=SUBSTITUTE(A1,"_"," ")
→ first lastFill the formula down to process more rows. To replace the originals, copy the results and use Paste Special → Values after checking them. Some regional settings use semicolons between arguments. For a quick one-off list, copy the cell text into this online tool; it does not open or edit Excel workbooks.
Microsoft’s SUBSTITUTE referenceWhy is the Remove underscores button disabled?
The removal button activates only when your text contains an underscore. If it stays disabled, check the character you pasted: a line beneath a word may be underlining, and a dash between words is a different symbol. Neither needs an underscore replacement.
If Paste cannot read your clipboard, click inside the text box and use Ctrl+V, Command+V, or your phone's paste menu. Clipboard access depends on your browser's permissions. When copying is blocked, the editor selects your text so you can copy it manually. After the underscores are removed, the removal button becomes inactive until you add text containing another underscore. Refreshing the page clears the editor, so copy your result before leaving.
What the underscore remover changes and preserves
Underscores and other characters
This tool targets the typed underscore. It leaves hyphens, em dashes, and letters untouched. Need to clean copied styling too? Use Remove Text Formatting to prepare plain text for your next document.
Line breaks, formatting, and privacy
The editor keeps text and line breaks, not fonts, colors, or document layouts. Replacement runs in your browser without sending your text to a server for processing. No account is needed.
Spacing after underscore removal
Review spacing in the first few lines before reusing your text. For a different punctuation cleanup, our EM Dash Remover handles em dashes with its own replacement options.