Text to slug
Cómo Añadir un Título becomes como-anadir-un-titulo and Hello World becomes hello-world: lowercase, no accents, no punctuation, just words joined by hyphens. Ready for blog permalinks, product pages and redirect maps. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Text
- Hello World
- Slug
- hello-world
- Original
- Hello World
- Length
- 11
- Words
- 2
This text-to-slug tool takes a non-empty title or phrase and returns a single URL-friendly slug: every letter is lowercased, accents and other diacritical marks are stripped, and words are joined with hyphens so the result is safe for path segments, CMS permalinks, and static site routes. Slugs are the everyday shape of blog post URLs, product paths, documentation pages, and sitemap entries that must stay readable without spaces, punctuation, or non-ASCII noise. Feed it spaced titles, accented Spanish or French headlines, mixed punctuation, or noisy marketing copy, and the engine rebuilds one deterministic hyphenated slug. Nothing is guessed from a model, nothing is fetched over the network, and nothing depends on the clock or random seeds.
Where text-to-slug conversion fits in publishing, SEO, and software
Writers and editors meet slugs when a CMS demands a clean permalink for a post title, when a static site generator freezes front-matter into a folder name, or when a documentation tree maps chapter headings into nested URL paths. SEO practitioners normalize campaign headlines into consistent path segments so analytics, sitemaps, and internal links share one shape. Teachers can pre-generate answer keys that show the expected slug for accented sample titles without trusting opaque spreadsheet macros that change locale rules mid-file.
Backend and frontend developers use slugs for blog routes, product pages, knowledge-base articles, and redirect maps that must stay human-readable while remaining path-safe. Integration teams convert legacy CMS titles into stable hyphenated keys before migration scripts freeze the public URLs. Mobile and cross-platform apps map human labels into shared slug identifiers that bridge deep links and web fallbacks.
Support and operations teams paste noisy ticket subjects or release codenames into slugs so dashboards and runbooks share one identifier shape. Pair it with case converters, encode tools, or other free deterministic text helpers when you are building a small lab for forms, CMS prep, and URL hygiene.
What you can do with it
CMS and blog permalinks
Turn post titles and page headings into clean hyphenated slugs for CMS routes, static site generators, and sitemap entries.
Migration and redirect maps
Normalize legacy accented titles into stable path segments before building redirect tables and public URL inventories.
FAQ
What does the text-to-slug converter cost?
It is free in your browser on this page.
How is the slug built from a title?
The engine strips accents via Unicode NFD, lowercases letters, replaces non-alphanumeric runs with hyphens, and trims leading or trailing hyphens.
What happens if the text is empty?
Empty strings, whitespace-only, and punctuation-only titles do not produce a slug.
Does this tool transliterate non-Latin scripts?
It removes Latin diacritics and keeps ASCII letters and digits. Characters outside a-z and 0-9 after accent stripping become hyphens and may leave an empty result if nothing alphanumeric remains.
Is the result deterministic?
Yes. The same title always yields the same slug. There is no network, randomness, or date-dependent behavior in the transform.
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/str/slugify \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Hello World — Café Ñandú!"}'const res = await fetch("https://api.kit.forhosting.com/str/slugify", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "Hello World — Café Ñandú!"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/str/slugify",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "Hello World — Café Ñandú!"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/str/slugify", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"Hello World — Café Ñandú!"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"Hello World — Café Ñandú!"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/str/slugify", 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": "Hello World — Café Ñandú!"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "str.slugify",
"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 and punctuation-only strings fail with a clear invalid_input error so a blank form cannot look like a successful conversion. Use it free in the browser for content prep, SEO checks, and data cleanup, or call the API at $0.002 per successful request when CI, CMS pipelines, or teaching demos need the same slug every time.
What text-to-slug conversion means and what the response contains
Text-to-slug conversion turns a multi-word title into one path-safe identifier where every letter is lowercase, accents are gone, and words are separated by single hyphens, with no spaces or other punctuation between them. In practice Hello World becomes hello-world, a Spanish headline such as Cómo Añadir un Título becomes como-anadir-un-titulo, Café Ñandú 2024 becomes cafe-nandu-2024, and noisy marketing copy with exclamation marks collapses into a clean hyphen chain. There is no partial mode that only lowercases without stripping accents, no locale-specific transliteration tables beyond Unicode NFD decomposition of combining marks, and no silent coercion of null into an empty success. The transform is not camelCase, not CONSTANT_CASE, not PascalCase, and not a title-case display string: only the SEO-friendly lowercase slug remains. This calculator returns five stable fields: slug holds the URL-friendly result you will paste into a CMS, sitemap, or route table; original echoes the exact input string so you can audit what was transformed; length reports the character count of the slug; words counts how many hyphen-separated tokens were produced; and method is the fixed tag slugify for logs and multi-tool pipelines. The engine either builds a complete slug inside the supported length or rejects the request with invalid_input. Rejected cases include a missing text field, a null value, an empty string, whitespace-only or punctuation-only payloads that leave no letter or digit tokens, 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 the result stays reproducible
The value must be a non-empty string; finite numbers and bigints are stringified first so a bare numeric code still becomes a slug token after conversion to decimal digits. Leading and trailing whitespace are absorbed during the non-alphanumeric replacement step; internal runs of spaces, underscores, hyphens, dots, em-dashes, and other non-alphanumeric characters act as word breaks and become single hyphens in the output only between tokens. Diacritics are removed with Unicode NFD normalization followed by a strip of combining marks in the standard range, so á, é, í, ó, ú, ñ (as n plus tilde after decomposition where applicable), ü, and similar Latin letters fold to their ASCII bases before lowercasing completes. Each remaining letter is lowercased with the default JavaScript case mapping, which keeps Hello, HELLO, and hello on the same hello token after processing. The preferred field is text, but aliases input, string, value, content, s, title, and phrase 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 convert a title, not invent a blank success. 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 slug inside an automated pipeline without shipping your own string helpers.
Where text-to-slug conversion fits in publishing, SEO, 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.
Integration use cases
Deterministic slug fixtures
Generate reproducible URL slugs for unit tests, golden files, and CI assertions on routing and SEO transform code.