What Year was the Typewriter Invented?

The first legal patent was filed in Britain and the first typewriter built as a result was in 1867. There was also a writing machine patent filed in 1714.