GNU Aspell – A Free, Open Source And Independent Spell Checker

GNU Aspell - A Free, Open Source And Independent Spell Checker

Today, we are going to talk about GNU Aspell, a free, open source and independent spell checker. You can use it either as a library or an independent spell checker on your Unix-like operating systems. Aspell will suggest the possible replacement for your misspelled words in a word/document. Unlike other spell checkers like Ispell, Aspell can also easily check documents in UTF-8 without having to use a special dictionary. It has support for using multiple dictionaries at once. In this brief tutorial, we will see how to install Aspell and how to use it to check spelling mistakes in a given word and/or document.

Installing GNU Aspell

GNU Aspell is available in the default repositories of most Linux distributions, so installation won’t be a big deal.

On Arch Linux and derivatives like Antergos, Manjaro Linux, run:

sudo pacman -S aspell

On Fedora:

sudo dnf install aspell

On RHEL, CentOS:

sudo yum install epel-release
sudo yum install aspell

On Debian, Ubuntu:

sudo apt-get install aspell

By default, Aspell won’t have any dictionaries. To add a dictionary, for example English, just install this package – aspell-en. Similarly, to add Spanish dictionary, install aspell-es package.

This can also be found in the default repositories. For instance, to add English dictionary on Arch linux, run:

sudo pacman -S aspell-en

On Debian, Ubuntu:

sudo apt-get install aspell-en

On Fedora:

sudo dnf install aspell-en


sudo yum install aspell-en

To add Spanish dictionary, use the following commands:

Arch linux:

sudo pacman -S aspell-es


sudo apt-get install aspell-es


sudo dnf install aspell-es


sudo yum install aspell-es

Once installed all dictionaries, you can ensure whether the required dictionaries are available or not using command:

$ aspell dicts

Well, I have two dictionaries installed in my system, English (including its variants) and Spanish. Now let us see how to spell check a word of document using Aspell.

Using Aspell

Spell Check single words

Aspell uses English language to check spelling by default.

Let us check the spelling of a word. To do so, type:

$ aspell -a

Then, intentionally type any misspelled word. And you will get the possible suggestions for the correct spelling.

@(#) International Ispell Version 3.1.20 (but really Aspell
& englsh 7 0: English, Englisher, Engels, English's, Englishes, Engels's, encl

If you type the correct spelled word, it will display an asterisk.

$ aspell -a
@(#) International Ispell Version 3.1.20 (but really Aspell

To use different language, for example Spanish, just use ‘-l’ with language code as shown below:

$ aspell -a -l es
@(#) International Ispell Version 3.1.20 (but really Aspell
& Holla 30 0: Hola, Halla, Holea, Hollé, Holló, Hulla, Hila, Hollad, Hollar, Hiela, Huella, Olla, Hala, Bolla, Folla, Molla, Polla, Rolla, Solla, Tolla, Halle, Hallo, Hallé, Halló, Helea, Holee, Holeo, Holeé, Holeó, Huela

Here, “es” is the language code for Spanish language.

We can also check spelling mistakes in different variant of language. For example, to check spelling errors in Canadian English dictionary, use -d and the language format (you can view the available English variants using “aspell dicts” command).

$ aspell -a -d en_CA

To exit spell checking, type CTRL+c.

You can also use ‘echo’ command in conjunction with aspell to check for spelling mistakes of a word. Take a look at the following example.

echo englsh | aspell -a

Sample output would be:

@(#) International Ispell Version 3.1.20 (but really Aspell
& englsh 7 0: English, Englisher, Engels, English's, Englishes, Engels's, encl

As you can see, Aspell suggest the possible replacements for the misspelled word ‘englsh’.

If you want to check spelling in another language, for example Spanish, use “-l” flag along with the language code like below.

echo englsh | aspell -a -l es

To check spelling of a misspelled word in Canadian English dictionary, run:

echo englsh | aspell -a -d en_CA

Alternatively, you can spell check a word as below.

aspell -a <<< englsh

Or, use this instead if you wanted to check spelling in another language.

aspell -a -l es <<< englsh

Spell check a file

I have a file ostechnix.txt with few lines in it.

$ cat ostechnix.txt

Now, let me check this for any possible spelling errors.

$ cat ostechnix.txt | aspell list

Sample output:


As you can see, Aspell lists the misspelled words from the given file. To use another language, use “-l” flag as shown below.

$ cat ostechnix.txt | aspell list -l es

To interactively check a file for possible spelling mistakes, we can use:

$ aspell check ostechnix.txt

Here is the output of the above command. Aspell suggests the possible replacements for the misspelled word. Just choose the correct words by entering the relevant number from the suggested words.

I type 1 (number one):

Once you selected the correct spelling, aspell will update the file with correct word and automatically move to another word and display the suggestions and so on.

If you think the spelling is correct for the selected words, type ‘i’ to ignore or type ‘a’ to add the word to the dictionary.

You can type ‘r’ to replace the selected word with your own spelling and press ENTER to accept the changes.

To add the lower case for the selected word, type ‘l’. Once you corrected all words, you will see nothing in output.

Again, If you wanted to check spelling with different language, just use ‘l’ as I mentioned in the previous examples.

Recommended Read:

Manually adding dictionaries

Some dictionaries might not be available in your distribution’s default repositories. For example, Tamil language dictionary is not available in Arch Linux default repositories. So, I had no choice but to compile and install it from source as described below.

Download the dictionary of your choice from here.


Extract the downloaded archive:

tar xvf aspell6-ta-20040424-1.tar.bz2

Go the directory aspell:

cd aspell6-ta-20040424-1/

Compile and install like below:

sudo make install

Once you successfully installed the dictionary, you will see the newly installed dictionary:

$ aspell dicts

Here, ta is the language code for Tamil language.

Now, you can check the spelling with your new dictionary as shown below.

echo வணக்கம் | aspell -a -l ta

To install other dictionaries, just refer the README file of the downloaded Dictionary.

And, that’s all for now. For more details, check the official website given at the end of this guide. More good stuffs to come. Stay tuned!


Thanks for stopping by!

Help us to help you:

Have a Good day!!

You may also like...

1 Response

  1. TheOuterLinux says:

    If you’re a nano user, the package you are looking for is “spell” if you want its spellchecker to work.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.