ToolsGrab
All Tools
All Tools

Home › Text Tools › Train Case Converter

Train-Case Converter

Convert any text to Train-Case — Title-Kebab format with capitalized words joined by hyphens.

Free

Try an example:

Input
0 characters
Train-Case Output
Train-Case output will appear here...

How It Works

hello worldHello-World
my_variableMy-Variable
camelCaseCamel-Case
SCREAMINGScreaming

What Is Train-Case and When Do You Use It?

Train-Case is a text formatting convention where each word is capitalized and words are separated by hyphens. It looks like this: This-Is-Train-Case. You can think of it as the love child of Title Case and kebab-case — it takes the capitalization of one and the hyphen separators of the other.

The name comes from the way it looks — each word is like a train car, connected by hyphens (the couplings), all capitalized (the rooftops). It's a bit of a niche format compared to camelCase or snake_case, but it shows up more than you'd expect.

Where is Train-Case actually used? HTTP headers are probably the most common place. The standard HTTP header names use exactly this format: Content-Type, Accept-Encoding, Cache-Control, X-Forwarded-For. If you're writing code that constructs or parses HTTP headers, knowing Train-Case is essential. Some programming languages and frameworks — particularly in the Ruby ecosystem — use Train-Case for certain naming conventions as well.

How does this converter work? It handles several input formats intelligently. If you paste camelCase or PascalCase text, it splits on the capital letter boundaries. If you paste snake_case or kebab-case, it splits on underscores and hyphens. If you paste plain text with spaces, it splits on whitespace. Extra spaces, dots, and mixed separators are all handled gracefully. Each word gets its first letter capitalized and the rest lowercased, then words get joined with hyphens.

It works on multi-line input too — each line is processed independently, so you can convert a whole list at once. The output is instant and updates as you type. Click any of the example chips at the top to see how different input formats get converted.

All processing is done in your browser. The converter uses a few regex replacements and a simple capitalize function — no server involved, no data stored, completely private.