Train-Case Converter

Capitalize each word and join them with hyphens, like Content-Type or X-Request-Id.

How to convert to Train-Case

  1. Paste your words into the top box. Put each name on its own line.
  2. The Train-Case result appears below straight away.
  3. Click Copy result.

Examples

InputTrain-Case
content typeContent-Type
x request idX-Request-Id
acceptLanguageAccept-Language
cache_controlCache-Control

Where you see Train-Case

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).