Build Status Documentation Status License: MIT

Babylon is the simplest, easiest-to-use language detector.


Via composer:

$ composer require programarivm/babylon


Instantiate a LanguageDetector to detect a text's language.

use Babylon\LanguageDetector;

$text = 'You will have your data soon, I remarked, pointing with my finger;
        this is the Brixton Road, and that is the house, if I am not very much

$isoCode = (new LanguageDetector($text))->detect();

Note: The text needs to be a few words length in order for the language to be detected correctly; otherwise false positives may take place.

Language Detection

Please read the Documentation to find out which languages can be detected so far, and also to learn how to add new ones easily.


The MIT License.


Would you help make this library better? Contributions are welcome.

  • Feel free to send a pull request
  • Drop an email at with the subject "Babylon Contributions"
  • Leave me a comment on Twitter
  • Say hello on Google+

Many thanks.