Is there an easy way to get a list of Category IDs?

there are some plugins that reveal the ID’s on the admin side like
WP Show IDs

and by code like this:

                  //as dropdown
$categories=  get_categories(array('hide_empty' => 0,'taxonomy' => 'category')); 
 echo '<select>';
  foreach ($categories as $category) {

    $option = '<option value="'.$category->category_id.'">';
    $option .= $category->cat_name;
    $option .= '</option>';
    echo $option;
  }
  echo '</select>';

  //or just print the categories names  by ids like this

  $categories=  get_categories(array('hide_empty' => 0,'taxonomy' => 'category')); 

  foreach ($categories as $category) {

    echo $category->category_id;
    echo $category->cat_name;

    }