IT Market
Tools/Text/Text Case/snake_case to kebab-case Converter Online
snake_case → kebab-case

Конвертер стилей именования

Tool guide

snake_case to kebab-case Converter Online

Paste names written in snake_case — my_variable_name, user_id, created_at — and get the same list back in kebab-case with hyphens instead of underscores. This comes up daily when database or Python field names move into front-end code: CSS classes, data attributes, file names and URL slugs all use hyphens. You can paste a whole column of names at once. The substitution runs inside the tab, with no upload. See also: go from camelCase back to snake_case, camelCase straight into hyphens, a clean page address from a string.

How to use it

  1. Paste your names into the «snake_case text» box — one per line or as running text, like the my_variable_name placeholder.
  2. Press «Convert»; every underscore becomes a hyphen and all other characters are left alone.
  3. Read the «kebab-case result» box and check that double underscores turned into double hyphens where that is acceptable.
  4. Press «Copy» and paste the list into your stylesheet, router or configuration file.
  5. Upper-case letters are not touched here — run the lowercase tool first if your source mixes cases.

FAQ

When should I use kebab-case instead of snake_case?

Underscores are the convention in Python, Ruby and SQL column names. Hyphens are the convention in CSS classes, HTML attributes, npm package names and URLs — search engines treat a hyphen as a word separator and an underscore as a word character.

What happens to a double underscore like __init__?

Each underscore is replaced independently, so __init__ becomes --init--. That is meaningless for Python dunder methods, so exclude them from the list before converting or fix the output by hand.

Can I convert a few hundred names at once?

Yes. Paste the whole column into the input box; line breaks are preserved and the output comes back line for line. It works well with names copied straight out of a DESCRIBE result or a migration file.

Does it lower-case the letters too?

No. It only swaps the underscore character for a hyphen, so User_Name becomes User-Name rather than user-name. Run the lowercase converter first if you need an all-lowercase CSS class or URL slug.

Is the output safe to use in a URL?

For ASCII names, yes. Non-Latin characters are kept as they are, and while browsers accept them they get percent-encoded in links and look unwieldy. Transliterate first if you are building slugs from non-Latin text.

Is there a kebab-to-snake direction?

Not on this page — it converts one way only. The reverse is the same single substitution and is quickest done with find-and-replace in your editor. Related camelCase converters live in the same text tools section.

Does my code get uploaded anywhere?

No. The substitution runs in a script on the page, and the field contents never leave the tab. That makes it safer for internal table and column names than services that process input on a backend.

Examples

Database columns into CSS classes
Before: user_id order_total created_at
After: user-id order-total created-at
File name into a URL slug
Before: how_to_pick_a_laptop_2026
After: how-to-pick-a-laptop-2026