How to create a linked tag list in my sidebar

This will output a list of all tags, sorted by the most used tag first. Each tag has the number of times it has been used following the tag in parentheses. The parentheses and number of times used is in a <span>. To remove the parentheses, change <span>(' . $tag->count . ')</span> to <span>' . $tag->count . '</span>

<ul id="tags-list">
<?php
$tags = get_tags( array('orderby' => 'count', 'order' => 'DESC', 'number'=>20) );
foreach ( (array) $tags as $tag ) {
echo '<li><a href="' . get_tag_link ($tag->term_id) . '" rel="tag">' . $tag->name . ' <span>(' . $tag->count . ')</span> </a></li>';
}
?>
</li>
</ul>

This will return the 20 most used tags. Remove , 'number'=>20 to get all tags.