How to Remove URLs from Text Online

How to Remove URLs from Text Online

How to remove URLs from text online: strip every link — http, www and bare domains — and keep your words intact, free in your browser, with no upload.

How to Remove URLs from Text Online

Paste your text into a URL remover, and every web address comes out while the rest of the sentence stays put. “Read more at https://example.com/guide and let me know” becomes “Read more at and let me know” — the words survive and the link is gone. That double space in the middle is the first of three small surprises in this job.

A URL is not one thing. It can start with http:// or https://, or with www., or it can be a bare domain like example.com/page with no prefix at all. It can be a short link like bit.ly/3xK2pQ9, or it can be hiding inside a Markdown link where only the label is visible. A tool that only looks for “http” will miss half of these, and a tool that is too eager will eat the full stop at the end of your sentence or strip an email address you wanted to keep.

Key takeaways

  • Removing URLs deletes web addresses only. Words, numbers, punctuation and email addresses stay.
  • Pick the mode first: delete every URL, replace each one with a placeholder like [link], or keep only the URLs and drop the rest of the text.
  • Links come in more shapes than http:// — www. links, bare domains and short links all count, and a good tool catches all of them.
  • Watch the punctuation. A full stop, comma or closing bracket right after a link is part of your sentence, not part of the URL.
  • Markdown links like [label](url) need a decision: drop the whole link, or keep the label and drop only the address.
  • Removing a URL does not remove the spaces around it. Expect double spaces where a link sat between two words.
  • Word, Google Docs and Excel can remove hyperlinks, but that is not the same as removing the link text.

What counts as a URL?

Before running anything, it helps to know what you are asking the tool to find. The standard that defines how web addresses are written is RFC 3986, and in practice a URL in ordinary text shows up in a handful of shapes.

Full links with a scheme are the obvious ones: https://coreaiweb.com/how-to-remove-spaces-from-text-online/ and http://example.com/page. Then there are www links: www.example.com/page has no scheme, but it is still a link. Bare domains are the ones people miss: example.com/page or example.com on its own, with no www and no http. Short links are another shape: bit.ly/3xK2pQ9, t.co/abc123, tinyurl.com/xyz. Then there are Markdown links, common in notes and AI drafts: [read the guide](https://example.com/guide). Only the label “read the guide” is visible, but the address is sitting inside the parentheses.

What is not a URL matters just as much. An email address like name@example.com is not a URL, even though it contains a domain. A file path like C:\Users\docs\file.txt is not a URL. A hashtag or an @mention is not a URL.

Choose the mode before you paste anything

Most URL removers offer more than one operation, and they are not interchangeable. The table below is the decision to make first, because the same text gives a different result under each one.

ModeWhat it doesUse it when
Delete all URLsEvery link is removed and nothing takes its placeCleaning a caption, a product description or a spreadsheet column where links do not belong
Replace with placeholderEach link becomes [link], [URL] or a word you chooseThe reader should know a link was there, or the sentence would read strangely without one
Keep only URLsEverything except the links is deleted, leaving a list of addressesPulling every link out of a long document to check them or share them
Keep Markdown label[label](url) becomes just “label”Turning notes or an AI draft into plain readable text without losing the words

Delete-all is the default most people want. The placeholder mode earns its place when the sentence depends on the link: “Details at [link]” reads better than “Details at” followed by a gap. Keep-only is an extraction, not a cleanup — pick it when the links themselves are what you want.

How to remove URLs from text online

The whole job takes under a minute with a browser tool, and nothing needs to be uploaded anywhere — the text never leaves your own browser.

First, copy the text that contains the links. Paste it into the tool’s input box. Choose the mode: delete all, replace with a placeholder, or keep only the URLs. If the tool has a checkbox for Markdown links, decide now whether labels should survive. Some tools also offer a “tidy spaces” option — turn it on, because it collapses the double spaces left behind. Click the remove button, read the result, and copy it out.

Before you paste the result into the place it is going, read it once. The check takes ten seconds and it catches the two most common mistakes: a link the tool missed, usually a bare domain or a short link, and a full stop the tool ate.

The trailing-punctuation trap

This is the single most common way URL removal goes wrong. Consider this sentence: “Full details are at https://example.com/guide.” The full stop after “guide” belongs to the sentence. But to a simple pattern matcher, the link could be “https://example.com/guide.” — with the dot included — because dots are legal inside URLs. The same problem shows up with commas, closing brackets and closing parentheses: “See (https://example.com/page) for details” has a closing bracket that is not part of the link, and “Visit www.example.com/page, then come back” has a comma that is not part of it. A tool that strips the punctuation along with the address leaves you with a sentence that has lost its bracket or its full stop.

A careful tool treats sentence punctuation as separate from the URL, and stops matching before a trailing full stop, comma, semicolon, colon or closing bracket. The practical way to check a tool is to test it on one sentence with a link followed by a full stop. If the stop survives, the tool handles this correctly. If it vanishes, the tool is not safe for prose.

Markdown links need a decision, not a default

Markdown links are the second trap, because they contain two things at once: visible words and a hidden address. “[read the guide](https://example.com/guide)” is one link in Markdown, and removing it can mean two different things. Drop the whole thing and you lose the words “read the guide” as well as the address. Keep the label and you get plain readable text: “read the guide”.

Most of the time, keeping the label is the right call. The label is part of the sentence — “read the guide for the full list” makes sense without the link, and it makes no sense with the words deleted. The exception is a link whose label is itself a URL, like [https://example.com](https://example.com), where keeping the label keeps the address you were trying to remove.

Short links and bare domains are the ones that get missed

Full https:// links are easy to find. The ones tools miss are the quieter shapes. A short link like bit.ly/3xK2pQ9 has no recognisable domain pattern beyond the shortener’s name, and a generic matcher that only looks for “http” will catch it only if the short link includes the scheme. A bare domain like example.com/page has no scheme and no www, so a matcher that requires one of those two will walk straight past it. In a chat export or a social post, these two shapes are often the majority of the links.

The way to test a tool is to feed it a line with all four shapes in it: a full https link, a www link, a bare domain and a short link. If all four disappear, the tool’s matching is broad enough. If the bare domain or the short link survives, the tool is only doing the easy half of the job.

What happens to the spaces

Removing a URL does not remove the spaces around it. “Read more at https://example.com/guide and let me know” has one space before the link and one after it. Delete the link and both spaces remain: “Read more at and let me know”. Two spaces where there should be one — visible in every cleaned-up paragraph if you do not deal with it.

The fix is a second pass that collapses repeated spaces into one. Most URL tools offer this as a “tidy whitespace” or “collapse spaces” option — turn it on and the problem goes away in the same run. If the tool does not offer it, the same cleanup is one step in any text tool: it is the same operation as removing spaces that appear twice in a row. Either way, do not skip it. Double spaces are the tell-tale sign of text that was cleaned by a machine and never read afterwards.

One related case: a link on a line of its own leaves an empty line behind. Tidy those in the same second pass, the way you would when removing duplicate lines.

Removing URLs in Word, Google Docs and Excel

Word, Google Docs and Excel can all remove hyperlinks. What they cannot do, without extra work, is remove the link text from plain text. That distinction decides whether the app is the right tool for the job.

In Word, right-clicking a hyperlink and choosing “Remove Hyperlink” takes away the clickability and the blue underline, but the words stay. If the link text is itself a URL — the paragraph literally reads https://example.com/page — then removing the hyperlink changes nothing visible at all. Word’s Find and Replace can search for “http*” with wildcards, but it cannot reliably match every shape of URL in one pass, and it will happily eat the full stop at the end of a sentence.

Google Docs is in the same position. Removing a link takes away the hyperlink; the text stays. Docs has no built-in “remove all URLs” command, and its Find and Replace has no URL pattern. Excel is similar again: right-click and “Remove Hyperlink” leaves the cell’s text untouched, and there is no built-in way to strip URLs out of cell contents.

Doing it in code: Python and JavaScript

If the same cleanup runs every day — a daily export, a feed, a report — doing it by hand stops making sense. Two short patterns cover most cases: match the URL shapes, replace them with nothing or with a placeholder, then collapse the leftover spaces.

In Python, the standard library’s re module does the work in a few lines. A pattern that catches the common shapes looks like this:

import re

def remove_urls(text):
    text = re.sub(r'https?://\S+|www\.\S+|[a-zA-Z0-9-]+\.[a-zA-Z]{2,}(/\S*)?', '', text)
    return re.sub(r' {2,}', ' ', text).strip()

That pattern matches http and https links, www links, and bare domains with a path. It is a starting point, not a finished product: it will miss some short links with unusual characters, and it can catch a filename if the filename looks like a domain. Test it on your own data before trusting it.

In JavaScript, the same idea in the browser or in Node is just as short:

function removeUrls(text) {
  return text
    .replace(/https?:\/\/\S+|www\.\S+|[a-zA-Z0-9-]+\.[a-zA-Z]{2,}(\/\S*)?/g, '')
    .replace(/ {2,}/g, ' ')
    .trim();
}

Both snippets collapse double spaces as part of the same pass. If the job also involves Markdown links, handle those before the general pattern: replace \[([^\]]+)\]\([^)]+\) with the captured label first, then run the URL pattern on what is left. Order matters — run the general pattern first and the Markdown link is already broken apart by the time you look for it.

When keeping the URLs is the better call

Not every link in a block of text is clutter. Sometimes the links are the point, and removing them makes the text worse rather than cleaner. Citations are the clearest case: if a paragraph says “according to the official guide” and the link is the evidence, deleting it leaves a claim with no source. The same applies to references at the end of a document and to any text where the reader is expected to follow the link to check the claim. In those cases the placeholder mode is the honest compromise.

Instructions are another case. “Download the form from the council website” is useless if the link to the form is gone. And in a spreadsheet, a column of source links is data, not decoration — removing it destroys information that cannot be rebuilt from the words around it. The question to ask before running the tool is simple: if someone reads this text after the links are gone, will they still be able to do what the text asks them to do?

Frequently asked questions

Will it remove email addresses too?

No. An email address like name@example.com is not a URL, and a good remover leaves it alone. If a tool strips your email addresses, it is matching domains too broadly.

What about links in brackets or parentheses?

A link inside brackets or parentheses is still a link, and a good tool removes it while leaving the brackets behind. “See (https://example.com/page) for details” should become “See () for details” — and then the empty brackets are yours to tidy up.

Can I keep the link text and remove only the address?

Yes, for Markdown links. The [label](url) format keeps the label and drops the address, so “read the guide” survives while the link goes. For a bare address with no label, there is nothing to keep — the address is the text.

Does removing a URL leave double spaces?

Yes, almost always. The spaces on either side of the link stay behind. Turn on the tool’s “tidy spaces” option, or run a second pass that collapses repeated spaces.

Can Word remove all URLs at once?

No. Word can remove hyperlinks — the clickability goes, the text stays — but it has no command to delete every URL from a document. For plain text, use a browser tool.

What is the difference between removing URLs and removing hyperlinks?

Removing a hyperlink takes away the clickability and the formatting; the visible text stays. Removing a URL deletes the address itself from the text. If the visible text is the address, removing the hyperlink changes nothing, and only removing the URL does the job.

Closing

Removing URLs from text stays a small job as long as three things are decided up front: what counts as a URL, which mode you are running, and what happens to the spaces afterwards. Pick delete-all for cleaning, a placeholder when the sentence needs to know a link was there, and keep-only when the links are the thing you want. Test the tool on one sentence with a link followed by a full stop, and on one line with all four URL shapes in it. If both survive the test, the rest of the text will come out clean.