PHP Classes

PHP AJAX Character Counter: Count characters in a text input using AJAX

Recommend this page to a friend!
  Info   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2023-10-02 (8 months ago) RSS 2.0 feedNot enough user ratingsTotal: 72 All time: 10,233 This week: 69Up
Version License PHP version Categories
ajax-character-count 1.0.0GNU General Publi...5PHP 5, Text processing, AJAX


This package can count characters in a text input using AJAX.

It provides an example page with a text input that uses a JavaScript script to send an AJAX request to the server using jQuery to call a script that gets statistics about the text entered by the user in the text input.

The package also provides a PHP script that takes the text passed to the server using the AJAX request and outputs a message that shows several types of statistics about that text.

Currently, it can return:

- Characters with spaces

- Characters without spaces

- Number of spaces

- Number of words

- Number of phrases

- Estimated number of minutes to read the text

Innovation Award
PHP Programming Innovation award nominee
October 2023
Number 4
Many sites use text inputs to let users enter text that will be used for publication.

Some publications limit the amount of text the users can enter so it does not take too long for others to read.

This package provides examples of HTML, JavaScript, and PHP to demonstrate how developers can implement a character counter tool that can be displayed next to a text input to show several types of statistics about the text entered by the users, like the current character count and the estimated time that other people will take to read the text.

Manuel Lemos
Picture of Pierre-Henry Soria
  Performance   Level  
Name: Pierre-Henry Soria <contact>
Classes: 46 packages by
Country: United Kingdom
Age: 33
All time rank: 37516 in United Kingdom
Week rank: 72 Up2 in United Kingdom Up
Innovation award
Innovation award
Nominee: 17x

Winner: 3x


PHP Ajax Character Counter


PHP Character Counter Online Tool is a PHP script tool allows visitors to count letters/characters, words, sentences/phrases, spaces, etc. in live. It even allows to analyze the text and calculate the reading time in real-time.


Pierre-Henry Soria


You can contact me at: ph7software [at]


This script is under General Public License 3 or later; See the LICENSE.txt file

  Files folder image Files  
File Role Description
Files folder imageinc (1 file)
Accessible without login Plain text file ajax.js Data Auxiliary data
Accessible without login Plain text file ajax.php Aux. Auxiliary script
Accessible without login HTML file index.html Data Example form page
Accessible without login Plain text file license.txt Doc. Documentation
Accessible without login Plain text file Doc. Documentation
Accessible without login Plain text file style.css Data Auxiliary data

  Files folder image Files  /  inc  
File Role Description
  Accessible without login Plain text file functions.php Aux. Auxiliary script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:10,233
This week:69Up