By default, WordPress text widget does not recognize shortcode, instead the shortcode will be displayed as text. If you wanted to use shortcode in text widget, use the code snippet below.

add_action( 'after_setup_theme', 'enable_shortcode_in_text_widget' );

function enable_shortcode_in_text_widget() {
	add_filter('widget_text', 'do_shortcode');
}

Just put this snippet into your theme’s functions.php