arrow_back Back to Notebook
python
python
January 10, 2019

Convert bytes into a String in python

I recently needed to convert a bytes object into a readable string format. I found that I could do so very easily using the following method.

Start with a bytes object

str = b'johnwiseman'

Convert bytes to String

You can convert the bytes value into a string value by decoding it into utf-8

.decode("utf-8")

For example

str = b'johnwiseman'
print str.decode("utf-8")

johnwiseman

Alternatively

print str(b'johnwiseman', "utf-8")

johnwiseman

Thanks for reading!

John Wiseman

Full-Stack Software Engineer building scalable digital solutions. specializing in modern web technologies and mission-critical systems.

© 2026 Wiseman Systems Pty. Ltd.

Navigation

Start a Conversation

Ready to discuss your next project? Let's build something extraordinary together.

Get in Touch