Tag binary encoding