ToolZoneX
Blog

Keep Only Numbers

Strip every character that isn't a digit from text, with an option to preserve decimal points and minus signs.

Result:

How to Use Keep Only Numbers

Paste any messy text into the box, and every character that isn't a digit is stripped out instantly — letters, spaces, and most punctuation all disappear. Leave "Preserve decimal points and minus signs" checked to keep values like -19.99 intact, or untick it to leave only the bare digits, which is handy for extracting something like a clean phone number or ID.

Example

"Call us at (555) 123-4567 or check your balance: -$42.50" becomes 555123-4567-42.50 with decimals and minus signs preserved, or 5551234567 4250-style digits only with that option unticked.

Common Use Cases

  • Extracting a clean phone number or ID from messy pasted text.
  • Pulling a numeric price or measurement out of a sentence or label.
  • Stripping formatting characters out of copied spreadsheet or form data before reuse.

FAQs

  • Will it keep the minus sign in a negative number? Yes, if "Preserve decimal points and minus signs" is checked — every hyphen/minus character in the text is kept, though note that in text with multiple dashes (like a formatted phone number), all of those dashes are preserved too, not just ones meant as a negative sign.
  • Does it keep commas used as thousands separators? No — commas are always removed; only digits (and optionally the decimal point and minus sign) are preserved.
  • Can I use this to clean up a pasted phone number? Yes — untick the decimal/minus option to strip parentheses, spaces, and dashes down to plain digits, giving you a clean number ready to dial or store.