Madrid is over 300km from the sea - but that doesn't mean you don't have a few options for a visit to the beach during your stay in Madrid.
The Nearest Real Beach to MadridWith the high speed AVE train, the nearest beach to Madrid is in Valencia. In one-hour-forty-minutes you can be in Valencia, where you can then take a taxi to the city beach. It is expensive but it's not an impossible day trip from Madrid. If you catch the 8.40am train from Madrid you will be in Valencia for 10.18am and on the beach by 11am. In 2013, this line was extended to connect Madrid to Alicante.
The AVE train also reaches the north-east of Spain, you can now get to beach cities of Tarragona and Barcelona in about two hours and forty minutes. Take a train at about 7.30am and you can be on the coast by a little past 10am!
See also: How to get from Madrid to Barcelona