Writing is thought to have been invented in Mesopotamia (modern-day Iraq) 6,000 years ago, in 4000 BC. There is a possible disputed instance of writing 2,000 years earlier, from tortoise-shell carvings excavated in China, although it is under debate whether these markings are complex enough to qualify as written language.
Mesopotamian cuneiform is the first widely acknowledged form of writing, created by pressing a reed stylus into soft clay and letting it harden. It began using logograms — a type of writing where, rather than corresponding to a sound, each symbol corresponds to an entire word. This type survives to this day in the form of some Chinese characters. Writing was a closely guarded skill used only by scribes and priests. Its original function was in accounting, for instance, tabulating how many slaves were working on a particular job. The founding of written words was closely accompanied by the first numbers.
After the practice began in Mesopotamia, it started to show up in a variety of other places worldwide. The first known Egyptian hieroglyphics, from the Narmer Palette, date back to 3100 BC, 900 years after the invention of Mesopotamian cuneiform. The mysterious Indus Valley civilization in India starting writing scripts around 3000 BC, although these have not been deciphered.
Around 2900 BC, Mesopotamian writing evolved to include sounds, rather than just logograms. In about 2600 BC, Sumerian speech was translated into written syllables via cuneiform. Made out of brittle clay, most of these ancient examples have been destroyed.
The world's first alphabet is known to have originated in Egypt in 2000 BC, based on hieroglyphics. It then spread to the Levant and the rest of the world. Many Egyptian hieroglyphics have been preserved in stone. Thanks to the Rosetta stone, which included writing in Ancient Greek alongside hieroglyphics, people were able to translate some of the symbols.