PHPackages                             jawira/case-converter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jawira/case-converter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jawira/case-converter
=====================

Convert strings between 13 naming conventions: Snake case, Camel case, Pascal case, Kebab case, Ada case, Train case, Cobol case, Macro case, Upper case, Lower case, Sentence case, Title case and Dot notation.

v3.6.0(11mo ago)1746.9M—3%920MITPHPPHP &gt;=7.4CI passing

Since Oct 25Pushed 11mo ago3 watchersCompare

[ Source](https://github.com/jawira/case-converter)[ Packagist](https://packagist.org/packages/jawira/case-converter)[ Docs](https://jawira.github.io/case-converter/)[ RSS](/packages/jawira-case-converter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (3)Versions (40)Used By (20)

Case converter
==============

[](#case-converter)

Use this library to convert string between:

NameMethodOutput example🐪 Camel case`toCamel()``myNameIsBond`👨‍🏫 Pascal case`toPascal()``MyNameIsBond`🐍 Snake case`toSnake()``my_name_is_bond`👩‍🏫 Ada case`toAda()``My_Name_Is_Bond`Ⓜ️ Macro case`toMacro()``MY_NAME_IS_BOND`🥙 Kebab case`toKebab()``my-name-is-bond`🚂 Train case`toTrain()``My-Name-Is-Bond`🏦 Cobol case`toCobol()``MY-NAME-IS-BOND`🔡 Lower case`toLower()``my name is bond`🔠 Upper case`toUpper()``MY NAME IS BOND`📰 Title case`toTitle()``My Name Is Bond`✍️ Sentence case`toSentence()``My name is bond`⚙️ Dot notation`toDot()``my.name.is.bond`Features:

- 🔁 [automatic case detection](https://jawira.github.io/case-converter/detection-algorithm.html)
- 🏭 [factory](https://jawira.github.io/case-converter/using-the-factory.html)
- 🌐 [i18n](#i18n)

[![Packagist Version](https://camo.githubusercontent.com/e234539892d25303c2897399ca3d18c453f9130f07c78c34e37d1fdad86f209a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a61776972612f636173652d636f6e7665727465723f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/jawira/case-converter)[![Packagist PHP Version Support](https://camo.githubusercontent.com/793bb2310c89ef3a97dd6e2aad30504da8314df36dca98383b8498aafaf021e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a61776972612f636173652d636f6e7665727465723f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/jawira/case-converter)[![Packagist Downloads](https://camo.githubusercontent.com/2c5e84c866e3986402a5eb38792707e6ec051b165c2fa52e056acb540ac21b84/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a61776972612f636173652d636f6e7665727465723f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/jawira/case-converter)[![Packagist License](https://camo.githubusercontent.com/d047b5317459f149dc3bd57d2340ba4caeb3ac9873b569df0fb151e1bbdea8a8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a61776972612f636173652d636f6e7665727465723f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/jawira/case-converter)
[![Maintainability](https://camo.githubusercontent.com/2034d73fbd3b5d331455c7e0bba496e7876e529e79b9f1f6e4972fff5bee5604/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33353637376636636537646163323761356430632f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/jawira/case-converter/maintainability)[![Test Coverage](https://camo.githubusercontent.com/ee0293f6dc280e7abf257858825d095518cf9bb06232e4dc0fea79f7da412016/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33353637376636636537646163323761356430632f746573745f636f766572616765)](https://codeclimate.com/github/jawira/case-converter/test_coverage)

Usage
-----

[](#usage)

Input string (i.e. *john-connor*) format is going to be [detected automatically](https://jawira.github.io/case-converter/detection-algorithm.html). Here's an example:

```
use Jawira\CaseConverter\Convert;

$hero = new Convert('john-connor');

echo $hero->toCamel();   // output: johnConnor
```

Of course you can explicitly set the format of input string:

```
echo $hero->fromKebab()->toSnake();   // output: john_connor
```

You can also use the [provided factory](https://jawira.github.io/case-converter/using-the-factory.html) to instantiate `Convert` class. A list of [all public methods](https://jawira.github.io/case-converter/api.html) is also available.

i18n
----

[](#i18n)

Fully compatible with non-english alphabets:

```
// Spanish
$esp = new Convert('DON_RAMÓN_Y_ÑOÑO');
echo $esp->toCamel();   // output: donRamónYÑoño

// Greek
$grc = new Convert('πολύ-Καλό');
echo $grc->toCamel();   // output: πολύΚαλό

// Russian
$rus = new Convert('ОЧЕНЬ_ПРИЯТНО');
echo $rus->toCamel();   // output: оченьПриятно
```

`case-converter` is compatible with *Simple Case-Mapping* and *Full Case-Mapping*. [Learn more about Case-Mapping](https://jawira.github.io/case-converter/case-mapping.html).

Installation
------------

[](#installation)

```
composer require jawira/case-converter
```

Documentation
-------------

[](#documentation)

Contributing
------------

[](#contributing)

- If you liked this project, ⭐ star it on GitHub. [![GitHub Repo stars](https://camo.githubusercontent.com/d5965dc6ef468182eac1048db61d02d3e4816d73f99d5d98d1f50eb95cb82ed1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6a61776972612f636173652d636f6e7665727465723f7374796c653d736f6369616c)](https://github.com/jawira/case-converter)
- Or follow me on X. [![Twitter Follow](https://camo.githubusercontent.com/6b819627ab62583ecad8c066018b68a1747a02cbdd65490c1c6f25e73881beeb/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6a61776972613f7374796c653d736f6369616c)](https://twitter.com/jawira)

License
-------

[](#license)

This library is licensed under the [MIT LICENSE](https://jawira.github.io/case-converter/license.html).

---

Packages from jawira
--------------------

[](#packages-from-jawira)

 [jawira/emoji-catalog ![GitHub stars](https://camo.githubusercontent.com/22510675fa5644c26212f855b959175260a169fce3b2df950b692923af91eacd/68747470733a2f2f62616467656e2e6e65742f6769746875622f73746172732f6a61776972612f656d6f6a692d636174616c6f673f69636f6e3d676974687562)](https://packagist.org/packages/jawira/emoji-catalog)Get access to +3000 emojis as class constants. [ jawira/plantuml-client ![GitHub stars](https://camo.githubusercontent.com/b48ba66d7a22d9499c8d4865b40934b2a1ea40a48fe3cf57f3dd466ce3d0ab6c/68747470733a2f2f62616467656e2e6e65742f6769746875622f73746172732f6a61776972612f706c616e74756d6c2d636c69656e743f69636f6e3d676974687562)](https://packagist.org/packages/jawira/plantuml-client)Convert PlantUML diagrams into images (svg, png, ...). [jawira/doctrine-diagram-bundle ![GitHub stars](https://camo.githubusercontent.com/462206b7e0f2710fb003bb443de5def28346b3391b6914c8e73b83a62ae7bcdf/68747470733a2f2f62616467656e2e6e65742f6769746875622f73746172732f6a61776972612f646f637472696e652d6469616772616d2d62756e646c653f69636f6e3d676974687562)](https://packagist.org/packages/jawira/doctrine-diagram-bundle)Symfony Bundle to generate database diagrams.[more...](https://packagist.org/packages/jawira/)

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance52

Moderate activity, may be stable

Popularity61

Solid adoption and visibility

Community29

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 99.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~73 days

Recently: every ~325 days

Total

39

Last Release

339d ago

Major Versions

v0.0.0 → v1.0.02017-10-26

v1.2.0 → v2.0.02019-03-26

v2.3.0 → v3.0.02019-06-30

PHP version history (6 changes)v0.0.0PHP &gt;=5.3

v1.1.0PHP &gt;=5.4

v2.0.0PHP ^7.1

v3.4.2PHP &gt;=7.1

v3.4.5PHP ^7.1 || ^8.0

v3.5.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/496541?v=4)[Jawira Portugal](/maintainers/jawira)[@jawira](https://github.com/jawira)

---

Top Contributors

[![jawira](https://avatars.githubusercontent.com/u/496541?v=4)](https://github.com/jawira "jawira (500 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (4 commits)")

---

Tags

ada-casecamel-casecobol-caseconvert-stringskebab-caselower-casemacro-casepascal-casephpsentence-casesnake-casetitle-casetrain-caseupper-casecamel casedot notationlower casekebab casesentence casesnake casetitle caseupper casepascal caseAda caseTrain caseCobol caseMacro case

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jawira-case-converter/health.svg)

```
[![Health](https://phpackages.com/badges/jawira-case-converter/health.svg)](https://phpackages.com/packages/jawira-case-converter)
```

###  Alternatives

[pharaonic/php-dot-array

Access array data quickly/easily using dot-notation and asterisk.

1011.6k3](/packages/pharaonic-php-dot-array)[michaels/data-manager

Simple data manager for nested data, dot notation array access, extendability, and container interoperability.

121.9k2](/packages/michaels-data-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
