Train-Case Converter
Convert text to Train-Case — capitalized words joined by hyphens, like cars of a train.
All cases — live preview (click any result to copy it)
Private by design — every conversion runs locally in your browser. Your text is never uploaded, stored or tracked.
Train-Case writes every word capitalized and joins the words with hyphens: Content-Type, User-Agent, My-First-Heading. The capitalized words linked by hyphens look like the cars of a train, which is where the name comes from. Its most famous habitat is the HTTP header: nearly every header a browser sends — Accept-Language, Cache-Control, X-Requested-With — is written in Train-Case.
Train-Case is the capitalized sibling of kebab-case, and the two are easy to confuse: kebab-case is all lowercase (content-type), Train-Case capitalizes each word (Content-Type). This converter produces true Train-Case from any input — phrases, camelCase identifiers, snake_case names — by splitting the text into words first, capitalizing each one, then joining them with hyphens.
When to use it
- Writing HTTP header names in documentation, code and API specs
- MIME types, email headers and other protocol fields that use the style
- Headings and labels where a formal, title-like hyphenated form is wanted
- Converting kebab-case or snake_case names into their Train-Case equivalent
- Matching legacy system conventions that expect capitalized hyphenated names
How it works
- The input is split into words using identifier-aware rules — spaces, underscores, existing hyphens, camel humps, acronym boundaries and numbers.
- Each word is capitalized: first letter uppercase, the remaining letters lowercase.
- The capitalized words are joined with single hyphens.
- Punctuation other than hyphens is removed as part of the split, so the output is one clean hyphenated token.
Examples
snake_case input converts word by word.
camelCase humps are split before capitalizing.
Good to know
Train-Case carries an interesting piece of internet history. HTTP header names are technically case-insensitive — a server must treat content-type, Content-Type and CONTENT-TYPE identically — yet for decades the Train-Case form was the universal written convention, taught in every spec and tutorial. HTTP/2 changed the wire format to all-lowercase field names, but documentation, developer tools and most APIs still display headers in Train-Case, and HTTP/3 kept the lowercase wire format while the convention in writing remains. Knowing the style — and being able to produce it reliably — is part of reading web technology fluently.
Outside protocols, Train-Case appears in some German-influenced technical writing, in older book and legal heading styles, and in file-naming schemes that want hyphen separation with title-like capitalization. Where it should not be used: URLs (use lowercase kebab-case — servers and filesystems may treat case differently) and programming identifiers (hyphens are read as minus signs in most languages).
Frequently asked questions
What is the difference between Train-Case and kebab-case?
The capitalization. kebab-case is all lowercase (my-first-post); Train-Case capitalizes every word (My-First-Post). Same hyphens, different case — and they are used in different places: kebab-case in URLs and CSS, Train-Case in HTTP headers and protocol fields.
Why are HTTP headers written in Train-Case?
Convention inherited from the earliest email and HTTP specifications. Header names are actually case-insensitive, but Train-Case became the standard written form — Content-Type, Set-Cookie, User-Agent — and it is still how headers are shown in documentation and developer tools today.
Is Train-Case the same as Title Case with hyphens?
Almost — with one difference. Title case keeps minor words (of, the, and) lowercase; Train-Case capitalizes every word without exception, including short ones: “State-Of-The-Art”, not “State-of-the-Art”.
Can I use Train-Case for URLs or file names?
It is not recommended. Some servers and filesystems are case-sensitive, so a Train-Case URL can break when typed in lowercase. Use kebab-case for URLs and files, and keep Train-Case for headers and display labels.
Is my text uploaded or stored?
No. The conversion runs entirely in your browser. Nothing you type is sent to a server, stored or logged.