<?xml version="1.0" encoding="us-ascii"?><InstanceReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Version>2.2.0.25</Version><hasSegments>false</hasSegments><hasScenarios>false</hasScenarios><ReportLongName>0202 - Disclosure - Basis of consolidation</ReportLongName><DisplayLabelColumn>true</DisplayLabelColumn><ShowElementNames>false</ShowElementNames><RoundingOption /><HasEmbeddedReports>false</HasEmbeddedReports><Columns><Column><Id>1</Id><IsAbstractGroupTitle>false</IsAbstractGroupTitle><LabelColumn>false</LabelColumn><CurrencyCode>USD</CurrencyCode><FootnoteIndexer /><hasSegments>false</hasSegments><hasScenarios>false</hasScenarios><MCU><KeyName>1/1/2010 - 12/31/2010
USD ($)

USD ($) / shares
</KeyName><CurrencySymbol>$</CurrencySymbol><contextRef><ContextID>Jan-01-2010_Dec-31-2010</ContextID><EntitySchema>http://www.sec.gov/CIK</EntitySchema><EntityValue>0000917851</EntityValue><PeriodDisplayName /><PeriodType>duration</PeriodType><PeriodStartDate>2010-01-01T00:00:00</PeriodStartDate><PeriodEndDate>2010-12-31T00:00:00</PeriodEndDate><Segments /><Scenarios /></contextRef><UPS><UnitProperty><UnitID>USD</UnitID><UnitType>Standard</UnitType><StandardMeasure><MeasureSchema>http://www.xbrl.org/2003/iso4217</MeasureSchema><MeasureValue>USD</MeasureValue><MeasureNamespace>iso4217</MeasureNamespace></StandardMeasure><Scale>0</Scale></UnitProperty><UnitProperty><UnitID>USDEPS</UnitID><UnitType>Divide</UnitType><NumeratorMeasure><MeasureSchema>http://www.xbrl.org/2003/iso4217</MeasureSchema><MeasureValue>USD</MeasureValue><MeasureNamespace>iso4217</MeasureNamespace></NumeratorMeasure><DenominatorMeasure><MeasureSchema>http://www.xbrl.org/2003/instance</MeasureSchema><MeasureValue>shares</MeasureValue><MeasureNamespace>xbrli</MeasureNamespace></DenominatorMeasure><Scale>0</Scale></UnitProperty></UPS><CurrencyCode>USD</CurrencyCode><OriginalCurrencyCode>USD</OriginalCurrencyCode></MCU><CurrencySymbol>$</CurrencySymbol><Labels><Label Id="1" Label="12 Months Ended" /><Label Id="2" Label="Dec. 31, 2010" /></Labels></Column></Columns><Rows><Row><Id>2</Id><IsAbstractGroupTitle>true</IsAbstractGroupTitle><Level>0</Level><ElementName>vale_BasisOfConsolidationAbstract</ElementName><ElementPrefix>vale</ElementPrefix><IsBaseElement>false</IsBaseElement><BalanceType>na</BalanceType><PeriodType>duration</PeriodType><ShortDefinition>No definition available.</ShortDefinition><IsReportTitle>false</IsReportTitle><IsSegmentTitle>false</IsSegmentTitle><IsSubReportEnd>false</IsSubReportEnd><IsCalendarTitle>false</IsCalendarTitle><IsTuple>false</IsTuple><IsEquityPrevioslyReportedAsRow>false</IsEquityPrevioslyReportedAsRow><IsEquityAdjustmentRow>false</IsEquityAdjustmentRow><IsBeginningBalance>false</IsBeginningBalance><IsEndingBalance>false</IsEndingBalance><IsReverseSign>false</IsReverseSign><PreferredLabelRole /><FootnoteIndexer /><Cells><Cell><Id>1</Id><IsNumeric>false</IsNumeric><IsRatio>false</IsRatio><DisplayZeroAsNone>false</DisplayZeroAsNone><NumericAmount>0</NumericAmount><RoundedNumericAmount>0</RoundedNumericAmount><NonNumbericText /><NonNumericTextHeader /><FootnoteIndexer /><CurrencyCode /><CurrencySymbol /><IsIndependantCurrency>false</IsIndependantCurrency><ShowCurrencySymbol>false</ShowCurrencySymbol><DisplayDateInUSFormat>false</DisplayDateInUSFormat><hasSegments>false</hasSegments><hasScenarios>false</hasScenarios></Cell></Cells><OriginalInstanceReportColumns /><Unit>Other</Unit><ElementDataType>xbrli:stringItemType</ElementDataType><SimpleDataType>string</SimpleDataType><ElementDefenition>No definition available.</ElementDefenition><IsTotalLabel>false</IsTotalLabel><IsEPS>false</IsEPS><Label>Basis of consolidation [Abstract]</Label></Row><Row><Id>3</Id><IsAbstractGroupTitle>false</IsAbstractGroupTitle><Level>0</Level><ElementName>us-gaap_OrganizationConsolidationAndPresentationOfFinancialStatementsDisclosureTextBlock</ElementName><ElementPrefix>us-gaap</ElementPrefix><IsBaseElement>true</IsBaseElement><BalanceType>na</BalanceType><PeriodType>duration</PeriodType><ShortDefinition>No definition available.</ShortDefinition><IsReportTitle>false</IsReportTitle><IsSegmentTitle>false</IsSegmentTitle><IsSubReportEnd>false</IsSubReportEnd><IsCalendarTitle>false</IsCalendarTitle><IsTuple>false</IsTuple><IsEquityPrevioslyReportedAsRow>false</IsEquityPrevioslyReportedAsRow><IsEquityAdjustmentRow>false</IsEquityAdjustmentRow><IsBeginningBalance>false</IsBeginningBalance><IsEndingBalance>false</IsEndingBalance><IsReverseSign>false</IsReverseSign><PreferredLabelRole>verboselabel</PreferredLabelRole><FootnoteIndexer /><Cells><Cell><Id>1</Id><IsNumeric>false</IsNumeric><IsRatio>false</IsRatio><DisplayZeroAsNone>false</DisplayZeroAsNone><NumericAmount>0</NumericAmount><RoundedNumericAmount>0</RoundedNumericAmount><NonNumbericText>&lt;!--DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" --&gt;
   &lt;!-- Begin Block Tagged Note 2 - us-gaap:OrganizationConsolidationAndPresentationOfFinancialStatementsDisclosureTextBlock--&gt;
   &lt;div align="left" style="font-family: Helvetica,Arial,sans-serif"&gt;
   &lt;div style="margin-top: 12pt"&gt;
   &lt;table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-size: 10pt; text-align: left"&gt;
   &lt;tr valign="top" style="font-size: 10pt; color: #000000; background: transparent"&gt;
       &lt;td width="3%" nowrap="nowrap" align="left"&gt;&lt;b&gt;2 &lt;/b&gt;&lt;/td&gt;
       &lt;td width="1%"&gt;&amp;#160;&lt;/td&gt;
       &lt;td&gt;&lt;b&gt;Basis of consolidation&lt;/b&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;/table&gt;
   &lt;/div&gt;
   &lt;div align="left" style="font-size: 10pt; margin-top: 6pt; margin-left: 4%"&gt;All majority-owned subsidiaries in which we have both share and management control are
   consolidated. All significant intercompany accounts and transactions are eliminated.
   Subsidiaries over which control is achieved through other means, such as stockholders agreement,
   are also consolidated even if we hold less than 51% of voting capital. Our variable interest
   entities in which we are the primary beneficiary are consolidated. Investments in unconsolidated
   affiliates and joint ventures are accounted for under the equity method (Note 15).
   &lt;/div&gt;
   &lt;div align="left" style="font-size: 10pt; margin-top: 6pt; margin-left: 4%"&gt;We evaluate the carrying value of our equity investments in relation to publicly quoted market
   prices when available. If the quoted market price is below book value, and such decline is
   considered other than temporary, we write-down our equity investments to quoted market value.
   &lt;/div&gt;
   &lt;div align="left" style="font-size: 10pt; margin-top: 6pt; margin-left: 4%"&gt;We define joint ventures as businesses in which we and a small group of other partners each
   participate actively in the overall entity management, based on a stockholders agreement. We
   define affiliates as businesses in which we participate as a noncontrolling interest but with
   significant influence over the operating and financial policies of the investee.
   &lt;/div&gt;
   &lt;div align="left" style="font-size: 10pt; margin-top: 6pt; margin-left: 4%"&gt;Our participation in hydroelectric projects in Brazil is made via consortium contracts under
   which we have undivided interests in the assets, and are liable for our proportionate share of
   liabilities and expenses, which are based on our proportionate share of power output. We do not
   have joint liability for any obligations. No separate legal or tax status is granted to
   consortia under Brazilian law. Accordingly, we recognize our proportionate share of costs and
   our undivided interest in assets relating to hydroelectric projects (Note 12).
   &lt;/div&gt;
   &lt;!-- Folio --&gt;
   &lt;!-- /Folio --&gt;
   &lt;/div&gt;
   &lt;!-- PAGEBREAK --&gt;
   &lt;div style="font-family: Helvetica,Arial,sans-serif"&gt;
   &lt;div align="right" style="font-size: 10pt; margin-top: 12pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;
   &lt;/div&gt;
   &lt;/div&gt;
</NonNumbericText><NonNumericTextHeader>&lt;!--DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" --&gt;
   &lt;!-- Begin Block Tagged Note</NonNumericTextHeader><FootnoteIndexer /><CurrencyCode /><CurrencySymbol /><IsIndependantCurrency>false</IsIndependantCurrency><ShowCurrencySymbol>false</ShowCurrencySymbol><DisplayDateInUSFormat>false</DisplayDateInUSFormat><hasSegments>false</hasSegments><hasScenarios>false</hasScenarios></Cell></Cells><OriginalInstanceReportColumns /><Unit>Other</Unit><ElementDataType>us-types:textBlockItemType</ElementDataType><SimpleDataType>string</SimpleDataType><ElementDefenition>Description containing the entire organization, consolidation and basis of presentation of financial statements disclosure. May be provided in more than one note to the financial statements, as long as users are provided with an understanding of (1) the significant judgments and assumptions made by an enterprise in determining whether it must consolidate a VIE and/or disclose information about its involvement with a VIE, (2) the nature of restrictions on a consolidated VIE's assets reported by an enterprise in its statement of financial position, including the carrying amounts of such assets, (3) the nature of, and changes in, the risks associated with an enterprise's involvement with the VIE, and (4) how an enterprise's involvement with the VIE affects the enterprise's financial position, financial performance, and cash flows.  Describes procedure if disclosures are provided in more than one note to the financial statements.</ElementDefenition><ElementReferences>Reference 1: http://www.xbrl.org/2003/role/presentationRef
 -Publisher FASB
 -Name FASB Staff Position (FSP)
 -Number FAS140-4 and FIN46(R)-8
 -Paragraph 8, C1, C7

Reference 2: http://www.xbrl.org/2003/role/presentationRef
 -Publisher AICPA
 -Name Accounting Research Bulletin (ARB)
 -Number 51
 -Paragraph 2-6

Reference 3: http://www.xbrl.org/2003/role/presentationRef
 -Publisher AICPA
 -Name Statement of Position (SOP)
 -Number 94-6
 -Paragraph 10

Reference 4: http://www.xbrl.org/2003/role/presentationRef
 -Publisher FASB
 -Name FASB Interpretation (FIN)
 -Number 46R
 -Paragraph 4, 14, 15

</ElementReferences><IsTotalLabel>false</IsTotalLabel><IsEPS>false</IsEPS><Label>Basis of consolidation</Label></Row></Rows><Footnotes /><NumberOfCols>1</NumberOfCols><NumberOfRows>2</NumberOfRows><ReportName>Basis of consolidation</ReportName><MonetaryRoundingLevel>UnKnown</MonetaryRoundingLevel><SharesRoundingLevel>UnKnown</SharesRoundingLevel><PerShareRoundingLevel>UnKnown</PerShareRoundingLevel><ExchangeRateRoundingLevel>UnKnown</ExchangeRateRoundingLevel><HasCustomUnits>false</HasCustomUnits><SharesShouldBeRounded>true</SharesShouldBeRounded></InstanceReport>
