Before running a calculation you must first find out what rate your brokerdealer is charging to borrow money. The broker should be able to answer this question. Alternatively, the firm's website may be a valuable source for this information, as should account confirmation statements and/or monthly and quarterly account statements. In any case, once the rate being charged is readily known, grab a pencil, a piece of paper and a calculator and you will be ready to figure out the total cost.
Suppose you want to borrow $30,000 to buy a stock that you intend to hold for a period of 10 days.
In order to calculate the cost of borrowing simply:
Take the amount of money being borrowed and multiply it by the rate being charged:
$30,000 x .06 (6%) = $1,800
Then take the resulting number and divide it by the number of days in a year. The brokerage industry typically uses 360 days  not 365:
$1,800 / 360 = 5
Next, multiply this number by the total number of days you have borrowed, or expect to borrow, the money on margin:
5 x 10 = $50.
Using this example, it costs $50 to borrow $30,000 for 10 days.
To learn more about margin, see the Margin Trading tutorial.
RELATED FAQS

Which leverage ratios are most useful for analyzing manufacturing companies?
See which leverage ratios investors and creditors are likely to use when analyzing the debt burdens for manufacturing companies. 
How do I unlever beta?
Learn how to calculate the unlevered beta of a company and understand the differences between standard beta versus unlevered ... 
Can real estate agents give referral fees?
Learn about the process, laws and guidelines of real estate agents paying other real estate agents for referrals and how ... 
What are the differences between gross profit and EBITDA?
Learn how to distinguish between gross profit and EBITDA figures and where to find the information necessary to calculate ...

Ceded Reinsurance Leverage
The ratio of ceded insurance balances to policyholders’ surplus. ... 
David Einhorn
Known for his short selling strategy, activist investor David ... 
Short Call
A type of strategy regarding a call option, which is a contract ... 
Total DebttoCapitalization Ratio
An indicator that measures the total amount of debt in a company’s ... 
Leveraged Buyback
A repurchase of significant amount of shares through the use ... 
Equity Multiplier
The ratio of a company’s total assets to its stockholder’s equity. ...