Convert kebab-case to PascalCase!

String
Result

Convert kebab-case to PascalCase!

Is the variable naming in the code you copied from somewhere else different from your code? Don't worry! It converts variables to your desired naming convention!

Converts kebab-case to PascalCase: user-avatar → UserAvatar, date-range-picker → DateRangePicker. Component files, custom element tags and Angular selectors are usually hyphenated, while the component, class or type that lives inside them is PascalCase.

Paste a list of file names, tag names or route slugs to get the matching class or component names, for example when importing a folder of Vue or Svelte files or registering web components.

How to use

  1. Set kebab-case → PascalCase.
  2. Paste file names, tags or slugs into String, one per line.
  3. Copy the names from Result.

Example

Input (kebab-case)
user-avatar.tsx
date-range-picker.tsx
order-status-badge.tsx
Output (PascalCase)
UserAvatar.tsx
DateRangePicker.tsx
OrderStatusBadge.tsx

The file names become component names and the .tsx extension is kept, so the result can be used directly when renaming files to the PascalCase convention.

Supported features

  • Capitalizes the first letter and every letter after a hyphen: order-status-badge → OrderStatusBadge.
  • Extensions and paths around the name, like .tsx or ./components/, stay as they are.
  • Digits stay attached: step2-form → Step2Form.

Use cases

Imports from a folder of components

With files named user-avatar.vue and date-range-picker.vue, the import lines need UserAvatar and DateRangePicker. Convert the file list to write the imports and the components registration.

Classes for custom elements

A web component registered as date-range-picker is usually implemented by a class named DateRangePicker. Convert the tag names to name the classes consistently.

Notes and limitations

  • A leading hyphen survives (-webkit-box → -WebkitBox), so vendor-prefixed names need a manual fix.
  • Segments that are only digits are glued on without a separator: item-2 → Item2, step-3-review → Step3Review.

FAQ

Can I rename my files with this?

This page only produces the text. Paste the file list, copy the new names, and use them in your rename command or editor.

Does it work for Angular selectors like app-user-card?

Yes, it gives AppUserCard. Angular class names usually drop the prefix and add a suffix (UserCardComponent), so edit those parts yourself.