kebab-case to Train-Case converter

Capitalise every word in a hyphenated name while keeping the hyphens, the usual way HTTP header names are written.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter kebab-case names (one per line or inside text).
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Each kebab-case name is split into words at the hyphens, and at any capital that follows a lowercase letter. Every word then starts with a capital and the words are joined with hyphens (-); acronyms such as MD5 keep their capitals. Symbols and spaces around the names are left as they are. Example: content-type becomes Content-Type.

Example

Result: Train-Case result: Content-Type X-Api-Key Accept-Encoding; Names processed: 3.

content-type
x-api-key
accept-encoding
Content-Type
X-Api-Key
Accept-Encoding

Limits and caveats

  • Special spellings of some headers are not known, so etag becomes Etag rather than ETag.
  • Every word in the pasted text is converted, including keywords and library names, so review the result before pasting it into code.

Questions about this tool

Does HTTP treat Content-Type and content-type differently?

No, header names are case-insensitive under RFC 9110, and Train-Case is a convention for readability. HTTP/2 sends header names in lowercase.

Does the tool know special spellings such as ETag?

No, etag gives Etag, but acronyms already written in capitals, as in Content-MD5, stay as they are.

How is Train-Case different from kebab-case?

Both separate words with hyphens, but kebab-case is all lowercase while every word in Train-Case starts with a capital.