Linear complementary dual (LCD) codes can be used to resist side-channel attacks and fault noninvasive attacks. Let da(n,6) and dl(n,6) be the minimum weights of all binary optimal linear codes and LCD codes with length n and dimension 6, respectively. In this article, we aim to obtain the values of dl(n,6) for n≥51 by investigating the nonexistence and constructions of LCD codes with given parameters. Suppose that s≥0 and 0≤t≤62 are two integers and n=63s+t. Using the theories of defining vectors, generalized anti-codes, reduced codes and nested codes, we exactly determine dl(n,6) for t∉{21,22,25,26,33,34,37,38,45,46}, while we show that dl(n,6)∈{da(n,6)−1,da(n,6)} for t∈{21,22,26,34,37,38,46} and dl(n,6)∈{da(n,6)−2, da(n,6)−1} for t∈{25,33,45}.