PHPackages                             malenki/coord2coord - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. malenki/coord2coord

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

malenki/coord2coord
===================

Convert spreadsheet coordinate to numeric coordinates and vice versa

1.2.0(10y ago)118MITPHPPHP &gt;=5.3.0

Since Mar 15Pushed 10y ago1 watchersCompare

[ Source](https://github.com/malenkiki/coord2coord)[ Packagist](https://packagist.org/packages/malenki/coord2coord)[ Docs](https://github.com/malenkiki/coord2coord)[ RSS](/packages/malenki-coord2coord/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

coord2coord
===========

[](#coord2coord)

Convert spreadsheet columns coordinates to numeric coordinates and reverse too

Why?
----

[](#why)

Sometimes, when you develop some code about some CSV or something like that, you have reference given by some people using spreadsheet value (column A, AA, Z…) or index value (1, 2, 3) or even index value starting to zero (0, 1, 2…).

So, this little library deals with that. So, you can easily switch from one system to another.

How?
----

[](#how)

You can play with it using two ways:

- By using library to use it into your code
- By using CLI script available.

Using the library
-----------------

[](#using-the-library)

Very simple, install it using *composer*. You can find it on .

Quick example converting spreadsheet column name to index starting from one:

```
use \Malenki\Coord2Coord;

$c2c = new Coord2Coord();
echo $c2c->l2d('A'); // 1
echo $c2c->l2d('Z'); // 26
echo $c2c->l2d('AA'); // 27
```

Now the same with index starting from zero (note the constructor's call):

```
use \Malenki\Coord2Coord;

$c2c = new Coord2Coord(true);
echo $c2c->l2d('A'); // 0
echo $c2c->l2d('Z'); // 25
echo $c2c->l2d('AA'); // 26
```

Example to show how to convert index to spreadsheet column name:

```
use \Malenki\Coord2Coord;

$c2c = new Coord2Coord();
echo $c2c->d2l(1); // 'A'
echo $c2c->d2l(26); // 'Z'
echo $c2c->d2l(27); // 'AA'
```

Again, we can also use starting point as zero:

```
use \Malenki\Coord2Coord;

$c2c = new Coord2Coord(true);
echo $c2c->d2l(0); // 'A'
echo $c2c->d2l(25); // 'Z'
echo $c2c->d2l(26); // 'AA'
```

You can also magically convert integer to letters or the reverse:

```
use \Malenki\Coord2Coord;

$c2c = new Coord2Coord();
echo $c2c->magic(1); // 'A'
echo $c2c->magic('A'); // 1
```

That's all to know!

But you must also know that if you use incorrect value for index (negative integer, non integer, or zero when starting point is one) then this raises an exception (`InvalidArgumentException` is it is not an integer or `OutOfRangeException` for other cases).

Also, if you use any other value than ASCII characters `a-zA-Z` for convert spreadsheet column name to index then an `InvalidArgumentException` occurs.

Using CLI script
----------------

[](#using-cli-script)

Again, install it using composer, then, `composer install` into root directory of sources.

A script is available into `bin\coord2coord`.

Other way is to use PHAR file, so, just [download it](http://malenkiki.github.io/coord2coord/coord2coord.phar) or create it using [box](https://github.com/box-project/box2) by doing `box build` into the root of sources.

Play with it is very simple:

```
bin\coord2coord --help #display help message
bin\coord2coord A Z AA 56 2
"A" => 1
"Z" => 26
"AA" => 27
"56" => BD
"2" => B
 bin/coord2coord --zero A Z AA 56 2
"A" => 0
"Z" => 25
"AA" => 26
"56" => BE
"2" => C

```

Simple, isn't it?

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~191 days

Total

3

Last Release

3748d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6af62130bd16d4e6bbaa5877829b6377386ef9fb6593592052dbb6eeb87c4a02?d=identicon)[malenki](/maintainers/malenki)

---

Top Contributors

[![malenkiki](https://avatars.githubusercontent.com/u/195776?v=4)](https://github.com/malenkiki "malenkiki (15 commits)")

---

Tags

excelspreadsheetOpenOfficecoordinate

### Embed Badge

![Health badge](/badges/malenki-coord2coord/health.svg)

```
[![Health](https://phpackages.com/badges/malenki-coord2coord/health.svg)](https://phpackages.com/packages/malenki-coord2coord)
```

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

14.3k318.2M1.5k](/packages/phpoffice-phpspreadsheet)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.2k70.2M245](/packages/openspout-openspout)[nuovo/spreadsheet-reader

Spreadsheet reader library for Excel, OpenOffice and structured text files

671891.8k8](/packages/nuovo-spreadsheet-reader)[faisalman/simple-excel-php

Easily parse / convert / write between Microsoft Excel XML / CSV / TSV / HTML / JSON / etc formats

578610.1k1](/packages/faisalman-simple-excel-php)[avadim/fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP

3051.4M11](/packages/avadim-fast-excel-writer)[akeneo-labs/spreadsheet-parser

Akeneo Spreadsheet parser. Reads XLXS files from Microsoft Excel and Open Office

147612.9k6](/packages/akeneo-labs-spreadsheet-parser)

PHPackages © 2026

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