Capitalize each word and join them with hyphens, like Content-Type or X-Request-Id.
How to convert to Train-Case
Paste your words into the top box. Put each name on its own line.
The Train-Case result appears below straight away.
Click Copy result.
Examples
Input
Train-Case
content type
Content-Type
x request id
X-Request-Id
acceptLanguage
Accept-Language
cache_control
Cache-Control
Where you see Train-Case
HTTP headers:Content-Type, User-Agent, Cache-Control and custom ones like X-Api-Key.
Email headers:Reply-To, Message-Id and Return-Path.
Hyphenated titles and names such as Jean-Luc or Rolls-Royce.
A note on acronyms
The converter treats acronyms as normal words, so "X-API-Key" becomes "X-Api-Key". Both forms work in HTTP because header names are not case sensitive, but if your documentation prefers full capitals for acronyms, adjust them after converting.
Frequently asked questions
What is Train-Case?
Train-Case capitalizes the first letter of every word and puts a hyphen between them, like Accept-Language. The capital letters look like the front of each carriage on a train.
Is Train-Case the same as HTTP-Header-Case?
Yes. It is the traditional way HTTP header names are written, so it is often called header case.
Are HTTP headers case sensitive?
No. Header names are not case sensitive, and HTTP/2 even sends them in lower case. Train-Case is still the common way to write them in documentation and code because it is easy to read.
How is it different from kebab-case?
Both use hyphens. kebab-case is all lower case (content-type) while Train-Case capitalizes each word (Content-Type).