Case Converter

Convert between camelCase, snake_case, kebab-case and eight more

Runs entirely in your browser. Your data never leaves this device.

Each line is converted independently
Input
Output

How to use it

  1. Paste your text or a list of identifiers into the input panel.
  2. Pick a target format from the dropdown. Conversion runs immediately.
  3. Each line is converted on its own, so a list stays a list.

How word boundaries are found

Every case conversion is really the same two steps: work out where the words are, then rejoin them with different rules. The interesting part is step one.

This tool splits on two signals. First, a lowercase or digit followed by an uppercase letter — that is the boundary inside displayName. Second, any character that is not a letter or a digit, which covers underscores, hyphens, spaces and punctuation. Together they mean the input format does not need to be declared: display_name, displayName, display-name and Display Name all reduce to ["display", "name"], and from there any output format is available.

Acronyms need a third rule. A run of capitals followed by a capital-then-lowercase marks a boundary, so HTTPServer splits as HTTP + Server and produces httpServer rather than the useless hTTPServer. This matches what most codebases do, though it is worth noting that .NET's own naming guidelines say to write HttpServer — treating the acronym as an ordinary word — precisely to avoid this ambiguity.

Where each convention belongs

Conventions are arbitrary but not optional; using the wrong one in a codebase reads as a mistake even when it works.

  • camelCase — JavaScript and TypeScript variables, Java methods, JSON field names
  • PascalCase — C#, Java and TypeScript types; C# properties and methods
  • snake_case — Python variables and functions, SQL columns, Ruby
  • CONSTANT_CASE — environment variables, compile-time constants
  • kebab-case — URLs, CSS class names, HTML attributes, npm packages
  • dot.case — configuration keys, some log field conventions

The mismatch that causes the most work is snake_case JSON meeting PascalCase C#. A payload full of created_at will not bind to CreatedAt unless you add an attribute or a naming policy — which is why this tool pairs naturally with the JSON to C# generator.

The one-way conversions

Most conversions round-trip. Two do not, and it is worth knowing why.

Anything that discards separators loses information about the original. helloWorld and HelloWorld both become hello_world; converting back gives you one of them, not necessarily the one you started with. And Sentence case and Title Case lowercase everything before recapitalising, so deliberate internal capitals — iPhone, PostgreSQL, McDonald — are flattened. There is no general rule that recovers them, because the tool cannot know which capitals were meaningful.

Frequently asked questions

How are word boundaries detected?

By a lowercase-to-uppercase transition, and by any non-letter character. So `displayName`, `display_name`, `display-name` and `Display Name` all resolve to the same two words, which means any format converts to any other.

What happens to acronyms like HTTPServer?

It splits as `HTTP` + `Server`, so you get `httpServer` rather than `hTTPServer`. This is the conventional handling, though note that .NET guidelines would have you write `HttpServer` in the first place.

Why is each line converted separately?

Because the common task is converting a list — a column of database columns to C# properties, or a set of API fields to TypeScript. Treating the whole input as one identifier would be almost never what you want.

What is the difference between Title Case and Sentence case?

Title Case capitalises every significant word and leaves short words like `of` and `the` lowercase. Sentence case capitalises only the first word of each sentence. Headings use the former; body text and UI labels generally read better with the latter.

Which case should I use where?

By convention: camelCase for JavaScript variables and JSON fields, PascalCase for C# and Java types, snake_case for Python and SQL columns, kebab-case for URLs and CSS classes, CONSTANT_CASE for environment variables.

Related tools

browse category →

Last updated: