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.

  1. 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.

  2. 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.

  3. 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

a_little_more_readablea little more readable

Replace underscores with spaces in headings, labels, and copied lists to separate the words.

Names and numbers

item_204_blueitem 204 blue

Keep letters and numbers in their original order while separating the parts of a copied label.

Exported labels

summer_reading_listsummer reading list

Turn an exported field name into a phrase that is easier to read in a document or message.

Repeated underscores

red___green___bluered green blue

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.

Python

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 last

Assign 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 reference
Excel

How 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 last

Fill 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 reference

Why 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.

Remove Underscores FAQs

Practical answers for text, strings, and spreadsheets.

How do I remove underscores from text online?

Paste your text and select Remove underscores. Underscores become spaces automatically. Review the result in the same editor and select Copy. Clear empties the editor when you are finished.

How do I replace underscores with spaces?

Paste your text and select Remove underscores. Each consecutive group of underscores becomes one space, so first__last becomes first last. Existing spaces and line breaks are preserved. No replacement settings are needed.

Can I remove underscores without adding spaces?

This tool turns underscores into spaces to keep words readable. For deletion without spaces in your own workflow, use text.replace("_", "") in Python or =SUBSTITUTE(A1,"_","") in Excel.

How do I remove underscores from a string in Python?

Use cleaned = text.replace("_", "") to delete every underscore. Use text.replace("_", " ") for spaces. Assign the result because Python strings are immutable. These are examples to run in Python; this page does not execute code.

How do I remove underscores in Excel?

In an empty cell, enter =SUBSTITUTE(A1,"_","") to remove every underscore from A1. Fill the formula down for other rows. Use " " as the last argument to insert spaces instead.

Does this tool change hyphens or em dashes?

No. Only the underscore character (_) changes. Hyphens, em dashes, letters, numbers, and other punctuation remain as they were. Underscores are converted into spaces.

Does this underscore remover keep line breaks?

Yes. Line breaks and tabs stay in place. Only underscores change. Consecutive underscores become one space, but existing whitespace is not trimmed.

Can I clean underscores in several lines at once?

Yes. Paste multiple lines and run one replacement for the entire text box. The editor does not upload spreadsheets, rename files, or change files on your device.

Does this tool remove underlining from text?

No. It replaces the typed underscore character (_). Underlined text is formatting, not an underscore, and hyphens and em dashes are different characters.

Is Remove Underscores free, and is my text uploaded?

The tool is free and needs no account. Replacement runs in your browser. The editor does not send your text to a server or save it between page visits.

Why is the Remove underscores button disabled?

The button is disabled when the editor contains no underscore characters. Paste text containing _, then try again. Text that is already clean can still be copied.

Why does the Paste button need clipboard permission?

Browsers control clipboard access and may block the Paste button. You can still paste directly into the editor with Ctrl+V, Command+V, or your phone’s paste menu.