Case Converter
Convert text between UPPERCASE, camelCase, snake_case, URL slugs, and more — all styles update live as you type.
By Alex van den Berg · Last reviewed · How we test our tools
Start typing above to see every case style at once.
Case style cheat sheet
| Style | Example | Typically used for |
|---|---|---|
| camelCase | firstName | JavaScript/Java variables & functions |
| PascalCase | FirstName | Classes, React components |
| snake_case | first_name | Python, Ruby, database columns |
| kebab-case | first-name | URLs, CSS classes, HTML attributes |
| CONSTANT_CASE | FIRST_NAME | Constants, environment variables |
| slug | my-post-title | Blog post & page URLs |
Why case conventions matter
Every programming language and style guide picks a default "case" for identifiers, and mixing them inside one project is one of the most common sources of small, annoying bugs. A JavaScript linter configured with ESLint's camelcase rule will flag user_name as an error; PHP's PSR-1/PSR-12 standards expect class names in PascalCase and method names in camelCase; Python's PEP 8 asks for snake_case functions and variables but PascalCase classes. None of these rules are arbitrary — they exist so that any developer can predict how something is named without checking, which speeds up reading code far more than it slows down writing it.
Case conversion also shows up constantly at integration boundaries. Many REST APIs return JSON in snake_case (first_name, created_at) because that matches their backend's database columns, while the JavaScript consuming that response is written in camelCase by convention. Rather than manually retyping every key when mapping a response into a frontend model, pasting the field list here and switching between snake_case and camelCase columns is often the fastest way to draft the mapping.
Outside of code, case conventions matter for URLs and files too. Web servers and most CMSs expect URL slugs in lowercase kebab-case — my-post-title rather than My Post Title — because spaces have to be percent-encoded and mixed case creates duplicate-content risk on servers where URLs are case-sensitive. Git branch names follow the same kebab-case convention by community norm (feature/add-login-page), while environment variables and constants are written in CONSTANT_CASE (DATABASE_URL, MAX_RETRIES) specifically so they stand out visually from regular variables at a glance.
Frequently Asked Questions
What's the difference between camelCase and PascalCase?
camelCase starts with a lowercase letter (firstName) while PascalCase capitalizes every word including the first (FirstName). camelCase is typically used for variables and functions; PascalCase for class and component names.
When should I use snake_case vs kebab-case?
snake_case is common in Python, Ruby, and database column names. kebab-case is common in URLs, CSS class names, and HTML attributes — hyphens aren't valid in most programming language identifiers, which is why code uses underscores instead.
Does this handle mixed input like already-camelCase text?
Yes. The converter detects word boundaries from spaces, hyphens, underscores, and camelCase capital letters, so pasting getUserName or already-kebab-cased text still splits into the correct individual words before reassembling in your chosen style.
What is a URL slug and why does it matter?
A slug is the lowercase, hyphenated, punctuation-free version of a title used in a URL path, e.g. my-blog-post-title. Search engines and browsers handle slugs more reliably than spaces or special characters, and clean slugs are considered good practice for SEO.
Why do REST APIs use snake_case but JavaScript uses camelCase?
Most backend frameworks (Rails, Django, Laravel) generate JSON keys directly from database column names, which follow SQL's traditional snake_case convention. JavaScript's own style guides settled on camelCase decades ago, so front-end code typically converts incoming snake_case fields to camelCase when mapping API responses into local objects — a case converter speeds up writing that mapping by hand.
What case should I use for Git branch names?
There's no enforced standard, but the overwhelming convention across open-source projects is lowercase kebab-case, often with a type prefix: feature/add-login-page or fix/header-overlap-bug. Spaces aren't allowed in branch names at all, and uppercase letters can cause confusing duplicate branches on case-insensitive filesystems (like default macOS/Windows setups), so kebab-case avoids both problems.
Is my text uploaded anywhere?
No — every conversion is a plain JavaScript string operation that runs locally in your browser. Nothing is sent to a server.