Train-Case Converter
Turn phrases into capitalized words joined by hyphens, such as Content-Type or User-First-Name. Each line is converted separately.
Characters: 0Words: 0Lines: 0
Case types with examples
Starting text: The Lord of the Rings
Train-Case
Every word starts with a capital and the words are joined with hyphens.
The-Lord-Of-The-Rings
kebab-case
Words are lowercase and joined with hyphens.
the-lord-of-the-rings
PascalCase
Words are joined with no spaces and every word starts with a capital.
TheLordOfTheRings
camelCase
Words are joined with no spaces; every word after the first starts with a capital.
theLordOfTheRings
snake_case
Words are lowercase and joined with underscores.
the_lord_of_the_rings
What is Train-Case?
Train-Case, also known as Header-Case, starts every word with a capital letter and joins the words with hyphens. "content type" becomes Content-Type and userFirstName becomes User-First-Name. The name comes from the words being linked together like carriages in a train. This converter splits your text at spaces, underscores, hyphens and camelCase boundaries, and converts each line separately.
Where Train-Case is used
The best-known use is HTTP header names, which are conventionally written this way: Content-Type, Accept-Language, Cache-Control, X-Request-Id. HTTP headers are not case sensitive, and HTTP/2 and HTTP/3 send them in lowercase, but documentation, logs and code usually show the capitalized form. It is also used for some file names and labels where a hyphenated, capitalized style is wanted.
Train-Case compared with similar styles
kebab-case has the same hyphens but no capitals (content-type). PascalCase has the capitals but no separators (ContentType). Title Case also capitalizes words but keeps spaces and leaves small words such as "of" lowercase. Train-Case capitalizes every word, including the small ones, so a name like "state of the art" becomes State-Of-The-Art.
How to use the Train-Case tool
- Paste one name or phrase per line into the box.
- Click Train-Case (or another naming style).
- Click the copy icon above the text and use the result.
Frequently asked questions
What is Train-Case?
Train-Case, also called Header-Case, starts every word with a capital letter and joins the words with hyphens, like Accept-Language.
Where is Train-Case used?
It is the traditional way to write HTTP header names such as Content-Type and X-Request-Id. HTTP headers are not case sensitive, but this style is the convention.
How is it different from kebab-case?
kebab-case is all lowercase (content-type). Train-Case capitalizes each word (Content-Type).