Twitter has advised its more than 330 million users to change their passwords after discovering an internal glitch in its system.

The social media giant discovered a bug that stored passwords in plain text in an internal system.

The glitch has now been fixed and the company says it has seen "no indication of breach of misuse" but has recommended that users change their passwords "as a precaution".

"Out of an abundance of caution, we ask that you consider changing your password on all services where you’ve used this password," chief technology officer Parag Agrawal said in a blog post.

Agrawal explained that Twitter normally masks passwords through a process called hashing using a function known as bcrypt, which replaces the actual password with a random set of numbers and letters that are stored in Twitter's system.

"Due to a bug, passwords were written to an internal log before completing the hashing process," he said.

"We found this error ourselves, removed the passwords, and are implementing plans to prevent this bug from happening again."

He added: "We are very sorry this happened. We recognise and appreciate the trust you place in us, and are committed to earning that trust every day."