Get magento subtotal from cart

You can also try following code it works for me

<?php echo Mage::helper('checkout/cart')->getQuote()->getSubtotal() ?>

Make sure your top cart block is extending a relevant block type such as Mage_Checkout_Block_Cart_Sidebar. If you do, you will have access to useful functionality that will save you rewriting unnecessary code.

For example, if you extend Mage_Checkout_Block_Cart_Sidebar - you can call getSubtotal()

An alternative would be to use the following:

Mage::getSingleton('checkout/session')->getQuote()->getSubtotal();

you can use this code:

$subtotals= Mage::getSingleton('checkout/session')->getQuote()->getSubtotal();

echo $formattedPrice = Mage::helper('core')->currency($subtotals , true, false);