Remove numbers from text — or keep only the numbers

Paste text and the tool deletes every digit and tidies the gaps, or, in the other mode, throws away the words and keeps only the numbers.

Live demo · real result from this tool
Mode

Result

Order shipped on March to B Baker Street.

Processed on your device — nothing is uploaded.

How to use Remove Numbers

  1. Paste your text into Your text.
  2. Choose a Mode: Remove digits to clean the words, or Keep only numbers to pull out the figures.
  3. Copy the result. Lines stay in the same order as your input.

What it does and when to use it

Digits are often noise. Product names carry stock codes, transcripts carry timestamps, and copied lists carry the numbers of the original list. Remove digits clears them out so only the words remain. Typical uses:

  • removing years, codes or prices before counting words or making a word cloud;
  • cleaning song or podcast transcripts that have timecodes;
  • anonymising sample text by deleting phone numbers, account numbers or dates;
  • stripping digits from usernames to find the base name.

Keep only numbers does the opposite. It is a quick way to get the digits out of order references, phone lists or log lines, one line of output per line of input.

For a smarter extraction that keeps decimals and thousands separators, such as 1,250.75 as one number, use the Number Extractor. To remove numbers only at the start of each line, use Remove Line Numbers, which leaves numbers inside the text alone. To delete a custom set of characters, try Remove Specific Characters.

How it works

The text is split into lines and each line is handled separately.

In Remove digits mode, every decimal digit is deleted. The tool then reduces runs of spaces to one, removes a space that ends up before . , ; : ! or ?, and trims the ends of the line. That keeps sentences readable after numbers vanish.

In Keep only numbers mode, the tool finds each unbroken run of digits on the line and joins the runs with single spaces. Everything else on the line is discarded. The processing happens in your browser.

Worked examples

Tidy gaps. Two recipe lines, “Step 1 . Mix 2 cups” and “Step 2 : Bake”, become Step. Mix cups and Step: Bake. The spaces left before the full stop and colon are closed up.

Keep only numbers. “Invoice 2026-114: 3 items, total 45.50 EUR.” gives 2026 114 3 45 50. The hyphen and the decimal point split runs of digits, so 45.50 becomes two numbers. In Remove digits mode the same line becomes “Invoice -: items, total. EUR.”, which shows that separators stay behind.

Line by line. Three lines, “Item 7 ok”, “no digits” and “٣ arabic”, in Keep only numbers mode give 7, an empty line, and ٣. The Arabic-Indic three is recognised as a digit.

Limits and tips

  • Codes that mix letters and digits, such as 221B or A4, lose only their digits.
  • Run Remove Empty Lines afterwards if you do not need the blank rows from Keep only numbers mode.

Frequently asked questions

Are numbers written as words removed?
No. Only digits are removed. "three" and "first" stay. Convert words to digits first with Words to Number if you need them gone too.
What happens to decimal points, commas and minus signs?
In Remove digits mode they stay, because they are not digits; tidy them with the Punctuation Remover if needed. In Keep only numbers mode they are dropped, so 45.50 comes out as two numbers, 45 and 50, and −3 comes out as 3.
Does it handle digits from other scripts?
Yes. Any character Unicode marks as a decimal digit counts, including Arabic-Indic (٣), Devanagari (३) and full-width digits. Superscripts such as ² and fractions such as ½ are not decimal digits and are left alone.
Why do some lines come out empty in Keep only numbers mode?
Each line is processed on its own and keeps its place, so a line with no digits becomes an empty line. That keeps the numbers lined up with the original rows, which helps when you paste them back into a spreadsheet.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close