Javascript Palindrome Checker

Simple javascript that allows you to check whether a given word / string is a Palindrome or not. A palindrome is a word or phrase which reads the same forward or reverse direction.


  • Used to reverse the string and check the given word is palindrome or not.
  • The checker returns true or false upon comparision.
  • The script considers spaces, punctuation marks, upper and lower cases.


Enter a word:
Reversed String
Is the word a palindrom?


Javascript Code

<!-- Script by -->
<!-- More scripts -->
<script type="text/javascript">
function reverse_string(str){var
stri = "";var
alen = str.length;for (var i = alen ; i > 0 ; i--){stri += str.charAt(i-1)}return stri;
function palindrome(str){return (str == reverse_string(str));
function palindrome_check(){var str = document.getElementById('inputstr').value;
if(str!=""){document.getElementById('reversestr').value=reverse_string(str);document.getElementById('ispalin').value=palindrome(str);return true;}else alert ('Enter String');
<!-- Script by -->


<table align=center style='border:1px solid green;color: #3D366F;font-size:13px;' cellpadding=5 cellspacing=5>

<tr><td>Enter the word:<input type="text" id="inputstr" size="6"></td></tr>

<tr><td><input type="button" value="Reverse Word" onclick="palindrome_check();">

<input type="text" id="reversestr" size="6""></td></tr>

<tr><td>Is the word a palindrom?<input type="text" id="ispalin" size="4" value="">



<td align=center>

<a href='' style='text-decoration:none;font-size:10;color:green;'>&copy;</a>




  • Release Date - 18-09-2009
  • Get free version without ©copyright link for just $10/-
  • For customization of this script or any script development, mail to


  • Copy and paste the javascript code into your HTML page to enable word checker.
  • Here, the function "palindrome_check()" is used to reverse and check the given string is palindrome or not.


Related Scripts

Free Javascript Scripts

Ask Questions

Ask Question