How many bytes are emoji characters in GO?

It takes 4 bytes for each emoji character and 1 byte for every ASCII character.

package main

import (

func main() {
	a := []byte("๐Ÿ˜‚")
	// prints 4

	b := []byte("H")
	// prints 1


Published by Dwain Maralack

Servant, Husband, Software Engineer and all round fun-loving guy, I work as a Developer at WooThemes.

Join the Conversation


  1. I meant UTF-8 but this was titled for my question as some times people do weird things ๐Ÿ™‚ and youโ€™re right not specific to Go ๐Ÿ˜‚.

    I played around with some sample code as I learn more about Go.

Leave a comment

Leave a Reply

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