ToolGrid — Product & Engineering
Leads product strategy, technical architecture, and implementation of the core platform that powers ToolGrid calculators.
Loading...
Preparing your workspace
Convert text to kebab-case format (lowercase words separated by hyphens) like 'my-variable-name'. Perfect for CSS class names, URL slugs, HTML attributes, and naming conventions that require lowercase hyphenated identifiers.
Note: AI can make mistakes, so please double-check it.
Free: up to 50,000 characters in-browser. Upgrade for larger inputs.
Optional AI Enhancement
No recent activity
Common questions about this tool
Paste your text into the converter. It automatically converts to lowercase, replaces spaces and underscores with hyphens, and creates kebab-case format like 'my-variable-name' or 'css-class-name'.
Kebab-case is commonly used for CSS class names, HTML attributes, URL slugs, command-line arguments, and naming conventions that require lowercase hyphenated identifiers. It's readable and URL-friendly.
Kebab-case uses hyphens (my-variable-name) while snake_case uses underscores (my_variable_name). Both are lowercase, but kebab-case is more common in CSS and URLs, while snake_case is common in Python.
Yes, the converter handles various input formats including camelCase, PascalCase, snake_case, and regular text. It intelligently detects word boundaries and converts them to kebab-case format.
Kebab-case works in CSS, HTML, URLs, and many languages, but some languages (like JavaScript) don't allow hyphens in variable names. Use kebab-case for CSS classes, HTML attributes, and URLs, not for variable names.
In this tool, kebab case means text where words are separated by a chosen delimiter (by default a hyphen) with no surrounding spaces, such as `my-cool-project`. When Preserve Case is off the converter forces everything to lowercase, but when it is on the tool keeps your original letter casing while still inserting the delimiter between words and segments.
Paste or type your text into the Your Input box and the converter immediately runs it through `toKebabCase`, which splits CamelCase boundaries, normalizes spaces and existing separators, strips unsupported symbols, and optionally lowercases everything. The resulting slug appears live in the Kebab Case Result panel, where you can copy it with one click and optionally have each copy saved into the history list.
The `toKebabCase` function walks your string in several passes: it inserts delimiters between camelCase transitions, replaces any spaces, underscores, hyphens, or dots with your selected delimiter, removes characters that are not letters, numbers, or that delimiter, normalizes basic Unicode accents, and then trims extra delimiters from the ends. Those steps produce a clean kebab-case string that is safe to reuse in URLs, file names, or CSS classes.
Turn on Bulk Mode in the Tool Settings panel and then enter one string per line in the input area; the component will split your input by newline, run each line through `toKebabCase` with the current settings, and join the results back together with line breaks. The output textarea will then show a kebab-case version for each original line in the same order, which you can copy and paste wherever you need.
You can type a page title or keyword phrase into the input and, if you like, click Optimize with AI so the `refineKebabWithAI` helper sends it to a Gemini model that returns a trimmed, Exploration Paths kebab-case slug. The tool then feeds that refined text back through the same converter so you end up with a concise, delimiter-safe URL string that avoids filler words and special characters while staying within the browser.
Verified content & sources
This tool's content and its supporting explanations have been created and reviewed by subject-matter experts. Calculations and logic are based on established research sources.
Scope: interactive tool, explanatory content, and related articles.
ToolGrid — Product & Engineering
Leads product strategy, technical architecture, and implementation of the core platform that powers ToolGrid calculators.
ToolGrid — Research & Content
Conducts research, designs calculation methodologies, and produces explanatory content to ensure accurate, practical, and trustworthy tool outputs.
Based on 2 research sources:
Learn what this tool does, when to use it, and how it fits into your workflow.
This kebab case converter is a kebab case converter online that transforms any text into kebab-case, the lowercase, hyphen-separated style often used in CSS class names, HTML attributes, URL slugs and configuration keys. You can paste text in almost any format, including plain phrases, snake_case, camelCase or PascalCase, and the tool will convert text to kebab case online into a clean output such as "my-variable-name" or "css-class-name".
The problem it solves is consistent, predictable naming across code and content. When you work across multiple tools, frameworks and teams, inconsistent naming styles lead to confusion and bugs. Manually converting from camel case to kebab case, snake case to kebab case, or Pascal case to kebab case is error prone, especially when dealing with mixed case, underscores, spaces, punctuation and non-ASCII characters. This tool automates those decisions, applies a precise sequence of transformations and shows which rules were applied.
The interface is built for both developers and non-technical users. Front-end developers can treat it as a kebab case generator for CSS class names and HTML ids, while content and SEO teams can use it as a kebab case slug generator for URLs. The main converter panel shows input and output side by side, a settings panel lets you customize delimiters and behavior, a history panel records past conversions and a dedicated AI enhancer can refine raw titles into SEO-friendly, concise kebab-case slugs.
Kebab-case is a naming style where all letters are lowercase and words are separated by hyphens or another delimiter. For example, "My Cool Project" becomes "my-cool-project". In many systems, kebab-case is easier to read than concatenated words and more URL-friendly than names with spaces or underscores. In CSS, class and id names are often written in kebab-case; in URLs, hyphen-separated slugs are common for improving readability and search engine clarity.
However, source text rarely arrives in perfect shape. Some text may be in camelCase ("myCoolProject"), PascalCase ("MyCoolProject"), snake_case ("my_cool_project") or include symbols, accented characters and mixed whitespace. A good converter must be able to detect boundaries between words, normalize separators and remove or adapt characters that are unsafe in CSS, HTML or URLs. A related operation involves converting to snake_case as part of a similar workflow.
This kebab-case converter applies a consistent set of rules to transform messy input into a safe identifier. It splits camelCase into words, replaces spaces, underscores, dots and hyphens with a single chosen delimiter, removes unsupported symbols and normalizes accented characters. It then applies casing rules, either forcing everything to lowercase or preserving the original case if you ask it to.
The tool also supports bulk mode, where each line of input is treated as a separate item, and outputs one converted line per input line. This is useful when you need to convert a list of names or labels at once. A rule insights panel lists which transformation steps were applied, providing transparency for users who want to understand exactly how their input was changed.
Front-end developers use the kebab case converter to generate consistent CSS class names and HTML id attributes from human-readable labels or design specs. For example, a heading like "Primary Button Large" can be converted to "primary-button-large" for use in stylesheets and templates.
Backend developers and DevOps engineers use the tool when creating configuration keys, environment variable names or command-line flags where a hyphenated lowercase style is preferred. The converter turns descriptive phrases and mixed-case identifiers into stable kebab-case keys. For adjacent tasks, converting to camelCase addresses a complementary step.
Content and SEO specialists use it to build URL slugs from article titles. A title such as "10 Tips for Better Site Performance!" can become "10-tips-for-better-site-performance", ready to be used in path segments while avoiding unsafe characters.
Teams on shared projects use history and bulk mode to ensure that naming is consistent across files and modules. By converting lists of sections or components in one go, they can avoid subtle typos or mismatched naming schemes.
People working with design systems and component libraries use the tool to translate design tokens and component names into a format suitable for code, CSS and documentation. Combining custom delimiters and preserve case settings can help integrate different naming standards.
The core kebab-case logic is contained in a function that accepts an input string and a settings object. It first checks whether the trimmed input is empty; if so, it returns an empty output and no rules. Otherwise, it initializes an empty rules list and begins transforming the text. When working with related formats, converting to PascalCase can be a useful part of the process.
To detect camelCase or PascalCase boundaries, it uses a regular expression that matches a lowercase or digit followed by an uppercase letter. When such a pair is found, it inserts the delimiter (surrounded by spaces for clarity during intermediate processing) between the characters and records a "Split CamelCase boundaries" rule.
Next, it normalizes whitespace and existing delimiters. A pattern matching sequences of whitespace, underscores, hyphens or dots is replaced with a single instance of the chosen delimiter. This step ensures that all separators are consistent, whether the input contained spaces, underscores or mixed symbols. A "Normalized spaces and separators" rule is recorded when this happens.
To handle special characters, the function escapes the delimiter for use in a regular expression, then constructs a pattern that allows only letters, numbers and that delimiter. Any other characters are stripped out. If this rule is triggered, a "Removed special characters" rule is added.
For Unicode normalization, the function checks for non-ASCII characters, then uses standard Unicode normalization in NFD form to decompose combined characters into base characters and diacritic marks. It removes diacritic marks using a range of combining code points. When this occurs, a "Normalized unicode characters" rule is added. In some workflows, converting to sentence case is a relevant follow-up operation.
Finally, if the preserve case setting is not enabled, the function converts the entire string to lowercase. If the original input contained uppercase letters, a rule is recorded noting that case was converted. After all transformations, the function trims leading and trailing delimiters using a regular expression built from the escaped delimiter.
The resulting output and the list of unique rules are returned. Before returning, the rules list is deduplicated by serializing each rule to JSON, creating a set, and then parsing each unique entry back to objects. This prevents duplicate rule descriptions when the same type of transformation is applied more than once.
The AI refinement function is separate. It checks that an API key is available and that the input is non-empty. It then calls an AI model with a prompt that asks for an optimized, semantic kebab-case slug, focused on keywords and without filler words. The function returns the trimmed AI response if available, or falls back to the original text if the AI call fails or produces no output.
Use the default hyphen delimiter when you need standard kebab-case for CSS classes, HTML attributes and URLs. Switch to an underscore or dot only when working with systems that explicitly require those separators. For related processing needs, converting to Title Case handles a complementary task.
Be aware that the converter removes special characters, including punctuation and some symbols. If you need to preserve certain characters, consider adjusting your input before running the conversion or manually reintroducing them after conversion.
When working with non-English text that includes many accented characters, remember that the Unicode normalization step may strip accents. This is often desirable for URL slugs and CSS names, but may not be appropriate if you must preserve exact spelling visually.
Bulk mode is powerful for batch operations, but it applies the same settings and transformations to every line. Review a sample line carefully to make sure the rules behave the way you expect before processing very long lists.
Treat AI refinement as an optional helper, especially for SEO. Always review the AI-suggested slugs to make sure they accurately represent your content and respect any naming rules or brand guidelines you must follow.
Keep in mind that some programming languages and environments do not allow hyphens in variable names. Use kebab-case for CSS classes, HTML attributes and URLs as intended, and choose other naming styles such as camelCase or snake_case for variables and function names inside code.
We’ll add articles and guides here soon. Check back for tips and best practices.
Summary: Convert text to kebab-case format (lowercase words separated by hyphens) like 'my-variable-name'. Perfect for CSS class names, URL slugs, HTML attributes, and naming conventions that require lowercase hyphenated identifiers.