24 converter Units · Currency · Files

Convert text to kebab-case dash-case Free Online Secure

Paste a line and read it back in kebab-case. The whole of it happens in your browser — nothing you type is sent anywhere, and the rules follow the language of this page rather than English.

Write it differently

Words joined by hyphens
About this writing
What it does Cuts the line into words, lowercases them and joins them with hyphens. A line already written in camelCase is cut there too, so “fooBar” becomes “foo-bar”.
What it does not do It does not keep punctuation. Commas, dots and dashes are boundaries between words, not characters to carry over — which is what you want for a CSS class or a file name, and not what you want for prose.
And the language Cutting into words needs boundaries. Chinese and Japanese are written without spaces, so a line in those scripts comes back as a single word — the page would rather say so than cut at a place it guessed.
Where it runs In your browser. What you type here is never sent anywhere, so a draft, a password or a client's name is as safe here as in a text editor.

Nothing uploaded

The same line in all seven writings

Writing The same line, written that way
uppercaseCRÈME BRÛLÉE FOR 2 — STRASSE 17, FOOBAR
lowercasecrème brûlée for 2 — straße 17, foobar
Title CaseCrème Brûlée For 2 — Straße 17, Foobar
snake_casecrème_brûlée_for_2_straße_17_foo_bar
kebab-casecrème-brûlée-for-2-straße-17-foo-bar
camelCasecrèmeBrûléeFor2Straße17FooBar
a URL slugcreme-brulee-for-2-strasse-17-foobar

Where these forms come from

Capital and small letters were once two different alphabets. The capitals are Roman, cut into stone with a chisel; the small letters descend from the Carolingian minuscule, shaped by a pen moving quickly across parchment. Printers kept the two in separate trays — the upper case and the lower case — and the names stuck long after the trays were gone. The programming forms are much younger and were invented to solve one problem: a name cannot contain a space. snake_case came out of early C, camelCase out of Smalltalk, kebab-case out of Lisp, and the URL slug out of the need to put a human title into an address where spaces and accents are not allowed.

Where you meet them

Title case belongs to headings and book titles; sentence case to almost everything else, and increasingly to interfaces, because it reads faster. snake_case names database columns and Python variables; camelCase names JavaScript variables and Java methods; kebab-case names CSS classes and file names in web projects. The slug is what turns an article's headline into the last part of its address, and it is the one conversion here that search engines read.

Questions people ask

Why does uppercasing sometimes change the number of letters?

Because case is a property of a language, not of a character. German ß becomes SS in capitals, so one letter becomes two. Turkish has a dotted and a dotless i, and uppercasing i gives İ rather than I — getting this wrong turns a Turkish word into a different one. The conversions here follow the rules of the page's own language, which is why the same input can give different results on the Turkish page than on the English one.

Why does the slug remove accents and punctuation?

Because an address has to survive being copied into a message, printed on paper and typed back in by hand. Accented letters are legal in a modern URL but get percent-encoded when copied, turning a readable address into a line of symbols. Stripping them down to plain letters, digits and hyphens keeps the address readable, shareable and identical everywhere it appears.

Is the answer exact?

Where both units are defined in terms of one another by whole numbers, yes — the page says so above the figure, and the only rounding is in how many digits are shown. Where the ratio has no finite decimal, the page shows twelve significant digits and says the relation is approximate rather than pretending otherwise.

Does anything I type leave my device?

No. The arithmetic runs in your browser; nothing is uploaded and there is no server to upload it to. Load the page once and it keeps working with the network switched off.

Why you convert text to kebab-case

Look at the address bar of almost any well-kept website and you will find words joined by hyphens: how-to-repot-a-fern, annual-report-2026, contact-us. Look inside a stylesheet and the class names do the same: main-menu, card-title, button-primary. Look at the flags of command-line tools and you find --dry-run and --no-cache. This is kebab-case, the words small and strung along a hyphen as meat on a skewer, and it is the form that the web adopted for names that people can see. To convert text to kebab-case is to take a phrase as you would say it and turn it into a name that works in an address, a class, a branch or a file.

Paste a line and read it back in kebab-case. The conversion happens in your browser, nothing you type is sent anywhere, and the rules follow the language of this page and not English. It cuts the line into words, lowercases them and joins them with hyphens. A line already written in camelCase is cut there too, so fooBar becomes foo-bar. Below you will find what exactly the page does and does not do, how it treats the awkward letters of different languages, why the web prefers hyphens to underscores, where kebab-case is the convention, and the traps that catch people who convert text to kebab-case in a hurry.

What the conversion does

Cut, lowercase, join

The page first cuts the line into words, lowercases each one and joins them with hyphens. The line Crème brûlée for 2 — straße 17, fooBar comes back as crème-brûlée-for-2-straße-17-foo-bar. Accents are kept, the numbers stay as words of their own, the dash and the comma are gone, and fooBar is cut in two at the capital.

Where the cuts fall

A word boundary is a space, a punctuation mark, a dash, a symbol or the step from a small letter to a capital inside a word. So Main Menu, mainMenu, main_menu and main--menu all become main-menu. The conversion accepts almost any starting point and always arrives at the same form, which is what makes it a safe last step before a name goes into a stylesheet or an address.

No stray hyphens

Repeated separators are squeezed into one, and no hyphen is left at the start or the end. A messy phrase like ...Hello, World!! comes out as hello-world, with nothing hanging off the ends.

What the conversion does not do

It does not keep punctuation

Commas, dots and dashes are boundaries between words, not characters to carry over. That is what you want for a CSS class or a file name, and not what you want for prose. A sentence run through the page comes back as a name, and the original punctuation is gone.

It does not remove accents

The line keeps its accented letters: crème-brûlée. Modern browsers and servers accept them in names and addresses, but older tools may not, and an address with accents is escaped into percent codes when copied. If you need plain letters, the URL slug page takes the marks off Latin letters as well.

It does not check that the name is free

Two different phrases can produce the same name, and the page does not know whether a name is already used on your site or in your project. Check for clashes before you publish.

The language matters

Scripts written without spaces

Cutting into words needs boundaries. Chinese and Japanese are written without spaces, so a line in those scripts comes back as a single word. The page would rather say so than cut at a place it guessed.

Turkish and the dotted i

Lowercasing follows the rules of the page's language. In Turkish the small form of I is ı, without a dot, and the small form of İ is i. A converter that applies English rules changes the words. This page follows the language it is written in.

German and the sharp s

German ß is already small and stays: straße-17. Capital STRASSE comes back as strasse, because the capital form does not remember whether it came from ß or from two letters.

Right-to-left and Indic scripts

Arabic, Hebrew and the Indian scripts have spaces between words and no case. The page joins their words with hyphens and leaves the letters alone.

Why the web prefers hyphens

Search engines read hyphens as spaces

Search engines treat a hyphen in an address as a separator between words, so how-to-repot-a-fern is understood as five words. An underscore, by contrast, is generally read as a joiner, and how_to_repot_a_fern may be read as one long word. For addresses people search for, hyphens are the better choice, and that habit has spread to the whole web.

Readability

An underscore can disappear when a link is underlined, since the line sits exactly where the underscore is. A hyphen stays visible. It is a small point, but it explains why the form took hold in addresses.

Case-insensitivity

Addresses are safest in lowercase, since parts of them can be case-sensitive on some servers. kebab-case is lowercase by definition, which removes a family of mistakes.

Where kebab-case is the convention

Web addresses

The last part of a page address, the slug, is nearly always in kebab-case. For addresses that must also be free of accents, use the URL slug page.

CSS and HTML

CSS properties are in kebab-case (background-color, font-size), and so are most class names and custom properties (--brand-color). HTML attributes such as data-user-id follow the same style. When you invent a class name for a component, kebab-case is what a reader of your stylesheet expects. If a component is also drawn with sizes, px to rem helps with the lengths.

File and folder names

Lowercase words joined by hyphens are a safe file name on every system, which is why static site generators and many frameworks use them for pages and assets.

Command-line options and package names

Flags such as --dry-run, package names on registries such as npm, and Git branches such as feature/login-form all follow kebab-case. A phrase turned into this form is likely to be accepted by the tools you use.

Lisp and its cousins

The form came from Lisp, where hyphens are allowed in names because the language has no use for them as subtraction signs without spaces around them. The name kebab-case is a joke about the skewer, and it stuck.

Where it is not the convention

Python, Ruby and databases

These prefer underscores, since a hyphen would be read as minus. For them, use snake_case.

JavaScript variables and Java

A hyphen in a variable name is a subtraction. These languages use camelCase. Kebab-case may still appear in their string values, file names and CSS.

Prose and titles

kebab-case is for names. Titles and sentences should keep their spaces and capitals. For a heading, consider Title Case.

How to convert text to kebab-case here

Paste or type your text

Enter the phrase in the first field. The result appears at once in the second, so you can watch it change as you type.

Check the name

Make sure it reads naturally and is not too long. Addresses of more than about sixty characters are cut off in search results. A good slug is short and says what the page is.

Copy it

Press the copy button and paste the result where you need it. For other forms of the same line, see below.

The same line in all seven writings

A table of forms

Below the converter, a table shows the example line in all seven forms the site offers: uppercase, lowercase, Title Case, snake_case, kebab-case, camelCase and a URL slug. It is a quick way to see how the same words look in each.

Where these forms come from

Two alphabets

Capital and small letters were once two different alphabets. The capitals are Roman, cut into stone with a chisel; the small letters descend from the Carolingian minuscule, shaped by a pen moving quickly across parchment. Printers kept the two in separate trays, the upper case and the lower case, and the names stuck long after the trays were gone.

Names without spaces

The programming forms are much younger and were invented to solve one problem: a name cannot contain a space. snake_case came out of early C, camelCase out of Smalltalk, kebab-case out of Lisp, and the URL slug out of the need to put a human title into an address where spaces and accents are not allowed.

Names that work well in practice

Short and descriptive

A good kebab-case name says what the thing is in as few words as possible. contact-us is better than please-get-in-touch-with-our-team. When you convert text to kebab-case, cut the phrase down first.

Stable over time

Names in addresses are promises: other sites link to them. Choose names that will still be true after a redesign, and avoid dates and version numbers unless they are the point.

Consistent across a project

If every page address, class name and file name follows the same rule, a newcomer can guess names correctly. When you convert text to kebab-case for a new page, check a neighbour for the pattern.

Free of stop words, if you like

Some people drop words such as the, a and of from addresses to keep them short. It is a matter of taste: the shorter address is tidier, the fuller one reads better aloud.

Kebab-case in a real project

Naming CSS classes

Component names in a stylesheet read best as short, hyphenated phrases: card, card-title, card-footer. Methodologies such as BEM add double hyphens and underscores for variations, but the base of every class is still a lowercase hyphenated name. When you convert text to kebab-case for a class, you are giving the next developer a name they can guess.

Naming files and folders for a site

A site's structure often mirrors its addresses, with a file called what-to-plant-in-april.html or a folder called garden-guides. Consistent hyphenated names make the structure easy to browse, easy to link to and easy to move between systems. If a page needs a data file, CSV to JSON and the other converters of the site can prepare it, and the same naming rule applies to the result.

Naming branches and tags in version control

Teams that use branches for each piece of work name them fix-login-redirect or add-search-filter. A branch name is read in lists, in pull requests and in chat, and a short hyphenated phrase is easy to scan. Many teams prefix with a type and a slash: feature/add-search-filter. To make the part after the slash, convert text to kebab-case from the title of the task.

Naming attributes and custom properties

Custom properties in CSS, such as --space-large and --brand-primary, are conventionally in kebab-case, and so are HTML data attributes. If you also work with colours, the notation HEX to RGB may be needed for the values that sit behind such names.

Keeping a record of old and new names

When you rename a batch of files or classes, keep a two-column list of the old and new names. It helps with search and replace, with redirects and with explaining to a colleague what happened. A converter makes the new names consistent; the list makes the change auditable.

Making addresses that last

Think of the reader first

An address is read by people before it is read by machines. A short, clear one tells the visitor where the link will take them and encourages them to click. When you convert text to kebab-case for a slug, imagine it pasted into a message with no other explanation, and ask whether it makes sense.

Do not repeat the section

If the address already has a folder named recipes, the page need not be called best-recipes-for-summer. A name like summer-salads is enough, and the address reads recipes/summer-salads without echo.

Traps when you convert text to kebab-case

Using it where a hyphen means minus

In most programming languages, a hyphen inside a name is subtraction. Do not use kebab-case for variables in such languages.

Forgetting that the name may exist

Two pages with the same slug clash. Check your site or your project before you publish.

Changing a published address

Once an address is public, changing it breaks links. If you must, set up a redirect from the old one.

Very long names

Long addresses are awkward to share and get shortened in search results. Trim the phrase before converting.

Questions people ask before converting

What happens to punctuation?

It is treated as a boundary between words and is not carried over.

Are numbers kept?

Yes, as words of their own, separated by hyphens.

Does it handle camelCase input?

Yes. A capital inside a word marks a cut, so fooBar becomes foo-bar.

Can I use it for other languages?

Yes, with the rules of the language of the page. Scripts without spaces, such as Chinese and Japanese, come back as a single word.

Is my text uploaded?

No. What you type here is never sent anywhere, so a draft, a password or a client's name is as safe here as in a text editor.

How do I get underscores instead?

With convert text to snake_case.

A worked example

Say you are adding a new section to a website and the editor has given you the title Spring Garden: What To Plant In April (and Why). You paste it and read spring-garden-what-to-plant-in-april-and-why. It is long, so you shorten the title to What to Plant in April and convert again: what-to-plant-in-april. You use it as the file name and as the address, and the same words, in the same form, as the class of the heading in the stylesheet. Three places, one name, written once.

A short checklist

Before converting

Shorten the phrase to what the name must say. Check that no existing name matches.

While converting

Paste the phrase, read the result and make sure it is natural and reasonably short.

After converting

Use the same name everywhere it applies, and set a redirect if you ever change a published address.

Common mistakes

Using kebab-case for variable names

A hyphen means minus in most languages.

Making names too long

Short names are easier to share and remember.

Changing published addresses

It breaks links. Redirect if you must.

Your text stays on your device

The conversion happens locally. Your text is handled by your own browser and nothing is sent anywhere. There is nothing to delete afterwards and no account to create. That is the plain way to convert text to kebab-case.

Summary

To convert text to kebab-case here, paste a line and read it back with the words cut, lowercased and joined by hyphens. A line already written in camelCase is cut there too, so fooBar becomes foo-bar. The page does not keep punctuation: commas, dots and dashes are boundaries between words, not characters to carry over, which is what you want for a CSS class or a file name and not for prose. Cutting into words needs boundaries, so Chinese and Japanese, written without spaces, come back as a single word. Lowercasing follows the language of the page. The web prefers hyphens because search engines read them as spaces. Nothing is uploaded.

Length & area Mass & volume Temperature Currency