AaCaseConvertly

Train-Case Converter

Convert text to Train-Case — capitalized words joined by hyphens, like cars of a train.

0 characters0 words0 lines0 sentences
Train-Case
Your Train-Case result will appear here…

All cases — live preview (click any result to copy it)

UPPERCASE
Start typing to see UPPERCASE…
lowercase
Start typing to see lowercase…
Title Case
Start typing to see Title Case…
Sentence case
Start typing to see Sentence case…
Capitalized Case
Start typing to see Capitalized Case…
aLtErNaTiNg CaSe
Start typing to see aLtErNaTiNg CaSe…
RaNdOm CaSe
Start typing to see RaNdOm CaSe…
iNVERSE cASE
Start typing to see iNVERSE cASE…
snake_case
Start typing to see snake_case…
camelCase
Start typing to see camelCase…
PascalCase
Start typing to see PascalCase…
kebab-case
Start typing to see kebab-case…
CONSTANT_CASE
Start typing to see CONSTANT_CASE…
Train-Case
Start typing to see Train-Case…
dot.case
Start typing to see dot.case…
slugify
Start typing to see slugify…

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

  1. The input is split into words using identifier-aware rules — spaces, underscores, existing hyphens, camel humps, acronym boundaries and numbers.
  2. Each word is capitalized: first letter uppercase, the remaining letters lowercase.
  3. The capitalized words are joined with single hyphens.
  4. Punctuation other than hyphens is removed as part of the split, so the output is one clean hyphenated token.

Examples

Input
content type
Output
Content-Type
Input
x_custom_header
Output
X-Custom-Header

snake_case input converts word by word.

Input
acceptLanguage header
Output
Accept-Language-Header

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.

Related tools