Madrid is the 0 km of Spain, right in the center of the country. From here you can get to know the whole of Spain, because every road starts here and every road leads here.
You have a lot of possibilities.
Tours form Madrid - Short distance
During your stay in Madrid you have the opportunity to visit for its neighborhood. Book a day trip to one of the exceptional UNESCO World Heritage Cities like Toledo, Segovia or Ávila.
Long distance by AVE
You can go much further! It is easy to get to Barcelona, Valencia or the capital of Andalusia, Seville by a high speed train. One day trips only for 2-3 hours from Madrid.