Strip URLs from text
«Visit https://example.com and also www.docs.example.org for help.» comes back as «Visit and also for help.», with 2 links removed and listed so you can check exactly what was cut. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
This strip-URLs-from-text tool takes any non-empty string and deletes every substring that looks like a web address: links that start with http:// or https://, and addresses that begin with www. You get back the cleaned prose, a count of how many URLs disappeared, and the exact list of removed strings so you can audit what was cut. The engine is fully deterministic: one fixed regular-expression pass, no network lookups, no randomness, and no clock dependency.
What gets removed and what you get back
URL stripping in this capacity means finding every contiguous substring that starts with the schemes http:// or https://, or with the common www. host prefix, and deleting those spans from the source text. The matcher stops at whitespace and a small set of delimiters so surrounding punctuation is not swallowed whole; trailing sentence punctuation such as periods, commas, and closing brackets that the regex still captured is peeled off before the URL is recorded and removed.
Bare domains without a scheme or www prefix are left untouched on purpose: example.com alone is not treated as a link, which keeps ordinary product codes and dotted identifiers safe. There is no option to keep only the host, no mode that rewrites links as markdown, and no silent coercion of null into an empty success.
If you need HTML tag stripping, whitespace removal, slug generation, or URL validation of a single address, use those dedicated tools; this page answers only multi-URL deletion from free-form text with a clear removal count.
Where stripping URLs from text fits in moderation, publishing, and software
Moderation teams strip links from user comments and chat logs before keyword scoring or length checks so spam URLs do not dominate token budgets. Content editors paste newsletter drafts and scraped blurbs into a cleaner that removes outbound addresses while keeping the surrounding sentences readable. Data scientists prepare training and evaluation corpora by deleting URLs that would otherwise leak site identity into bag-of-words features.
Support engineers sanitize ticket bodies before sharing snippets in public issues. Teachers use the free browser path to show students how noisy web paste becomes clean prose after a deterministic pass. Pair it with HTML-to-text, whitespace removal, or proofreading tools when you are building a small lab of free, deterministic text helpers for forms, CMS prep, and data hygiene.
What you can do with it
Comment and chat moderation
Remove outbound links from user comments and chat logs before scoring, archival, or public display, and keep a count of how many URLs were stripped.
Corpus and feature cleanup
Delete URL spans from scraped text and training samples so bag-of-words and embedding pipelines see prose instead of host noise.
Draft and ticket sanitization
Clean email drafts, support tickets, and CMS paste so editors work on readable sentences without embedded http or www addresses.
FAQ
Which URL patterns are removed?
Substrings that start with http://, https://, or www. Trailing sentence punctuation is peeled so periods and commas stay in the surrounding text. Bare domains without those prefixes are left unchanged.
Why is empty text rejected?
The product promise is to transform non-empty text.
Does the tool fetch or validate the links?
No. Matching is a pure string pass with a fixed pattern. There is no network request, DNS lookup, or live safety check.
Is a bare domain like example.com removed?
No. Only addresses that start with http://, https:// or www. are removed. A bare domain is left alone on purpose, so product codes and other dotted names in your text are not mistaken for links.
Does the period after a link disappear with it?
No. A period, comma or closing bracket right after an address is peeled off and kept in the sentence, so only the address itself is removed and the punctuation of your text survives.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/text/remove-urls-from-text \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Visit https://example.com and also www.docs.example.org for help."}'const res = await fetch("https://api.kit.forhosting.com/text/remove-urls-from-text", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "Visit https://example.com and also www.docs.example.org for help."
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/text/remove-urls-from-text",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "Visit https://example.com and also www.docs.example.org for help."
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/text/remove-urls-from-text", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"Visit https://example.com and also www.docs.example.org for help."}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"Visit https://example.com and also www.docs.example.org for help."}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/text/remove-urls-from-text", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "Visit https://example.com and also www.docs.example.org for help."
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "text.remove_urls_from_text",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_chars | 100000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Empty input is rejected with invalid_input so a blank form field never becomes a silent success. Use it free in the browser when you need to clean comments, chat logs, email drafts, or scraped snippets before analysis, or call the API at $0.002 per successful request when CI, moderation pipelines, or content workflows need the same reproducible result.
What URL stripping means and what the response contains
The response is small and stable for goldens and clients: text holds the cleaned result you will store or display; original echoes the exact input for audit trails; length is the character count of the cleaned result; removed_count is how many URL spans were deleted; removed_urls is the ordered list of those URL strings as they appeared after punctuation peel; and method is the fixed tag remove_urls_from_text for logs and multi-tool pipelines. The engine either builds a complete cleaned string inside the supported length or rejects the request with invalid_input. Rejected cases include a missing text field, a null value, an empty string, objects and arrays that are not plain text, and any payload longer than the documented maximum character count.
How the text field is read and how results stay reproducible
The value must be a non-empty string; finite numbers and bigints are stringified first so a bare numeric code still processes after conversion to decimal digits. Conversion uses a single regular-expression scan followed by right-to-left splice of matched spans—no locale tables, no machine-learning model, and no date-dependent exceptions. The preferred field is text, but aliases input, string, value, content, and s are accepted so query strings, spreadsheets, and typed forms can reuse the same contract without renaming columns. Booleans, plain objects, and arrays are rejected with a clear message so a mistaken JSON body does not become the word true or an unhelpful object dump. Empty string is always invalid_input: the product promise is transform non-empty text, not invent a blank success from a missing field. A string that contains no URLs is still a success: removed_count is zero, removed_urls is an empty array, and text equals original. Length is capped at one hundred thousand characters so a runaway paste cannot monopolize a Worker; longer payloads fail with an explicit limit message rather than a truncated silent cut. Pair the free browser run on this page with the priced API when you need the identical cleaned text inside an automated pipeline without shipping your own URL-strip helpers.
Where stripping URLs from text fits in moderation, publishing, and software
On this page the work runs entirely in your browser; through the API each successful conversion costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the string result.
Technical questions
What happens if the text has no URLs?
The call succeeds. text equals original, removed_count is 0, and removed_urls is an empty array. Only empty or missing text is rejected.
What does strip URLs from text cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.